ACE3/addons/sandbag/functions/fnc_canDeploy.sqf

30 lines
816 B
Plaintext
Raw Normal View History

2015-06-02 17:30:50 +00:00
/*
* Author: Ruthberg, commy2
2015-06-02 17:30:50 +00:00
* Checks if the player can deploy a sandbag
*
* Arguments:
* None
*
* Return Value:
* Can deploy <BOOL>
2015-06-02 17:30:50 +00:00
*
* Example:
* [ACE_player] call ace_sandbag_fnc_canDeploy
2015-06-02 17:30:50 +00:00
*
* Public: No
*/
#include "script_component.hpp"
#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"]
params ["_unit"];
if !("ACE_Sandbag_empty" in items _unit) exitWith {false};
private ["_surfaceClass", "_surfaceType"];
2015-08-08 00:00:00 +00:00
_surfaceClass = (surfaceType getPosASL _unit) select [1];
_surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron");
!(_surfaceType in SURFACE_BLACKLIST)