Modernize pickupAction function#654
Modernize pickupAction function#654DarkWiiPlayer wants to merge 5 commits intoAsYetUntitled:masterfrom
Conversation
| if (_cash) then { | ||
| _obj remoteExecCall ["life_fnc_pickupMoney",_client]; | ||
|
|
||
| if (_target getVariable "item" select 0 isEqualTo "cash") then { |
There was a problem hiding this comment.
check for "item" variable to be nil -> could theoretically happen. Better safe than sorry
| private _target = param [0, objNull, [objNull]]; | ||
|
|
||
| if (!isRemoteExecuted) exitWith { ["Not remote executed"] call BIS_fnc_error }; | ||
| if (isNull _obj) exitWith { ["Target object is NULL"] call BIS_fnc_error }; |
There was a problem hiding this comment.
_obj not defined -> you renamed it to _target
carries on throughout the file
| if (!isRemoteExecuted) exitWith { ["Not remote executed"] call BIS_fnc_error }; | ||
| if (isNull _obj) exitWith { ["Target object is NULL"] call BIS_fnc_error }; |
There was a problem hiding this comment.
don't know if there's a real reason, but I don't think Altis Life uses this function, so we shouldn't start doing so now for consistencies sake
|
By the way I assume these commits will all be squashed anyway, as there's no real point to keeping them around, so I'm not really trying to keep them atomic or anything ;D |
Co-authored-by: Blackfisch <blackfisch@outlook.com>
| if (isNull _obj) exitWith {}; | ||
| if (!(_target getVariable ["item", false]) isEqualType []) exitWith {}; | ||
|
|
||
| if !(_obj getVariable ["inUse",false]) exitWith { |
There was a problem hiding this comment.
would rather actually exit if its in use than executing code when it isnt
| if !(_obj getVariable ["inUse",false]) exitWith { | |
| if (_obj getVariable ["inUse",false]) exitWith {}; |
| private _target = param [0, objNull, [objNull]]; | ||
|
|
||
| if (!isRemoteExecuted) exitWith {}; | ||
| if (isNull _obj) exitWith {}; |
Co-authored-by: Blackfisch <blackfisch@outlook.com>
| ["_client",objNull,[objNull]], | ||
| ["_cash",false,[true]] | ||
| ]; | ||
| private _target = param [0, objNull, [objNull]]; |
There was a problem hiding this comment.
| private _target = param [0, objNull, [objNull]]; | |
| params [ | |
| ["_target", objNull, [objNull]] | |
| ]; |
Whether or not it's cash can be read from the variable and for the target client there's now the remoteExecutedOwner command.