-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2607 from acemod/340cleanupBackpacks
Code cleanup Backpacks
- Loading branch information
Showing
4 changed files
with
27 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#include "script_component.hpp" | ||
|
||
["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler); | ||
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
/* | ||
* Author: commy2 | ||
* Check if the given backpack is an actual backpack that can store items. Parachute, static weapon packs, etc. will return false. | ||
* | ||
* Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example. | ||
* Arguments: | ||
* 0: Backpack <OBJECT, STRING> | ||
* | ||
* Argument: | ||
* 0: A backpack (Object or String) | ||
* Return Value: | ||
* Boolean <BOOL> | ||
* | ||
* Return value: | ||
* Boolean (Bool) | ||
* Public: Yes | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
private ["_config"]; | ||
params ["_backpack"]; | ||
|
||
if (typeName _backpack == "OBJECT") then { | ||
_backpack = typeOf _backpack; | ||
}; | ||
|
||
private "_config"; | ||
_config = configFile >> "CfgVehicles" >> _backpack; | ||
|
||
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} | ||
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters