Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions addons/mission/functions/fnc_battlefieldMemorial.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ if (_position isEqualType "OBJECT") then {
_position = getPosATL _position;
};

// Error checking
if !(_helmet isEqualType "") exitWith {
ERROR_MSG_1("Invalid input (%1) expected classname as string.",_helmet)
};
if !(_weapon isEqualType "") exitWith {
ERROR_MSG_1("Invalid input (%1) expected classname as string.",_weapon)
// Error checking - Only in Editor
if (is3DENPreview) then {
if !(_helmet isEqualType "") exitWith {
ERROR_MSG_1("Invalid input (%1) expected classname as string.",_helmet)
};
if !(_weapon isEqualType "") exitWith {
ERROR_MSG_1("Invalid input (%1) expected classname as string.",_weapon)
};
};

private _memorial = createVehicle ["Land_BattlefieldCross_01_NATO_F", _position, [], 0, "CAN_COLLIDE"];
Expand Down
20 changes: 11 additions & 9 deletions addons/mission/functions/fnc_carAlarm.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@
params ["_vehicle", ["_removeAfterFiring", true]];

// Only add to Cars that would have alarms, extra check for wheeled APCs that inherit from Car_F
if !(_vehicle isKindOf "Car_F") exitWith {
ERROR_MSG_1("Vehicle (%1) is not a car.",_vehicle);
};
if (_vehicle isKindOf "Wheeled_APC_F") exitWith {
ERROR_MSG_1("Vehicle (%1) is not a car.",_vehicle);
};
if (is3DENPreview) then {
if !(_vehicle isKindOf "Car_F") exitWith {
ERROR_MSG_1("Vehicle (%1) is not a car.",_vehicle);
};
if (_vehicle isKindOf "Wheeled_APC_F") exitWith {
ERROR_MSG_1("Vehicle (%1) is not a car.",_vehicle);
};

// Needs empty vehicle
if (crew _vehicle isNotEqualTo []) exitWith {
ERROR_MSG_1("Vehicle (%1) must be empty.",_vehicle);
// Needs empty vehicle
if (crew _vehicle isNotEqualTo []) exitWith {
ERROR_MSG_1("Vehicle (%1) must be empty.",_vehicle);
};
};

// Don't add event if JIP and it's already been removed.
Expand Down
16 changes: 9 additions & 7 deletions addons/mission/functions/fnc_lockDoors.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ params ["_building", ["_doorIndex", []], ["_lockState", 1], ["_isGlobal", true]]
// If running globally, exit if not the server.
if (_isGlobal && !isServer) exitWith {};

// Exit if door index array is empty
if (_doorIndex isEqualTo []) exitWith {
ERROR_MSG("Door Index is empty.");
};
if (is3DENPreview) then {
// Exit if door index array is empty
if (_doorIndex isEqualTo []) exitWith {
ERROR_MSG("Door Index is empty.");
};

// Check lockstate value is correct.
if !(_lockState in [0, 1]) exitWith {
ERROR_MSG_1("Lock State is invalid (%1), expected 0 or 1.",_lockState);
// Check lockstate value is correct.
if !(_lockState in [0, 1]) exitWith {
ERROR_MSG_1("Lock State is invalid (%1), expected 0 or 1.",_lockState);
};
};

{
Expand Down
6 changes: 4 additions & 2 deletions addons/mission/functions/fnc_setSleeping.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ params ["_group", ["_asleep", true], ["_time", 0]];

if (!is3DENPreview && {hasInterface}) exitWith {};

if (_group isEqualType "OBJECT") exitWith {
ERROR_MSG("Input only allows group, detected unit.");
if (is3DENPreview) then {
if (_group isEqualType "OBJECT") exitWith {
ERROR_MSG("Input only allows group, detected unit.");
};
};

private _units = units _group;
Expand Down
6 changes: 4 additions & 2 deletions addons/mission/functions/fnc_surrender.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ params ["_group", ["_surrenderChance", 5], ["_minimumDistance", 400], ["_rallyCh

if (!is3DENPreview && {hasInterface}) exitWith {};

if (_group isEqualType "OBJECT") exitWith {
ERROR_MSG("Input only allows group, detected unit.");
if (is3DENPreview) then {
if (_group isEqualType "OBJECT") exitWith {
ERROR_MSG("Input only allows group, detected unit.");
};
};

_group setVariable [QGVAR(surrenderParams), [_surrenderChance, _minimumDistance, _rallyChance], true];
Expand Down
Loading