-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize pickupAction function #654
base: master
Are you sure you want to change the base?
Changes from 1 commit
7857e6f
15b49ce
685ff24
08d1ac0
7cf3f15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,22 @@ | |
/* | ||
File: fn_pickupAction.sqf | ||
Author: Bryan "Tonic" Boardwine | ||
|
||
Description: | ||
Validates that the cash is not a lie | ||
*/ | ||
params [ | ||
["_obj",objNull,[objNull]], | ||
["_client",objNull,[objNull]], | ||
["_cash",false,[true]] | ||
]; | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
carries on throughout the file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
|
||
if (isNull _obj || {isNull _client}) exitWith {systemChat "Obj or client is null?";}; //No. | ||
if (!(_obj getVariable ["inUse",false])) exitWith { | ||
DarkWiiPlayer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_client = owner _client; | ||
_obj setVariable ["inUse",true,true]; | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check for "item" variable to be nil -> could theoretically happen. Better safe than sorry |
||
_obj remoteExecCall ["life_fnc_pickupMoney", remoteExecutedOwner]; | ||
} else { | ||
_obj remoteExecCall ["life_fnc_pickupItem",_client]; | ||
_obj remoteExecCall ["life_fnc_pickupItem", remoteExecutedOwner]; | ||
}; | ||
}; | ||
} else { | ||
[ "Attempt to pick up money twice!" ] call BIS_fnc_error; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.