2015-06-02 17:30:50 +00:00
|
|
|
/*
|
2015-09-26 01:16:55 +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:
|
2015-08-08 00:28:27 +00:00
|
|
|
* Can deploy <BOOL>
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-09-26 01:16:55 +00:00
|
|
|
* [ACE_player] call ace_sandbag_fnc_canDeploy
|
2015-06-02 17:30:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-06-04 09:13:12 +00:00
|
|
|
#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"]
|
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
if !("ACE_Sandbag_empty" in items _unit) exitWith {false};
|
2015-06-04 09:13:12 +00:00
|
|
|
|
|
|
|
private ["_surfaceClass", "_surfaceType"];
|
2015-08-08 00:00:00 +00:00
|
|
|
|
2015-09-26 01:16:55 +00:00
|
|
|
_surfaceClass = (surfaceType getPosASL _unit) select [1];
|
2015-06-04 09:13:12 +00:00
|
|
|
_surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron");
|
|
|
|
|
|
|
|
!(_surfaceType in SURFACE_BLACKLIST)
|