mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
remove check ammo action on destroyed static weapons, fix #2671
This commit is contained in:
parent
42ce11cfee
commit
92ed7eeac2
@ -3,7 +3,7 @@
|
||||
* Check if the player can check the ammo of the target.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Player <OBJECT>
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
@ -16,22 +16,24 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_player,_target);
|
||||
|
||||
private ["_magazineType", "_magazineCfg"];
|
||||
params ["", "_target"];
|
||||
|
||||
// Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore
|
||||
if (_target isKindOf "StaticWeapon") exitWith {
|
||||
if (currentMagazine _target != "") exitWith {true};
|
||||
|
||||
private ["_magazines","_found"];
|
||||
_magazines = magazinesAmmoFull _target;
|
||||
_found = false;
|
||||
// no check ammo action on destroyed static weapons
|
||||
if (!alive _target) exitWith {false};
|
||||
|
||||
local _found = false;
|
||||
|
||||
{
|
||||
if (_x select 2) exitWith {
|
||||
_found = true;
|
||||
};
|
||||
} forEach _magazines;
|
||||
false
|
||||
} count magazinesAmmoFull _target;
|
||||
|
||||
_found
|
||||
};
|
||||
|
||||
@ -42,9 +44,7 @@ if !(_target isKindOf "CAManBase") exitWith {false};
|
||||
if (currentWeapon _target == "") exitWith {false};
|
||||
|
||||
// Check if their current magazine is a belt
|
||||
_magazineType = currentMagazine _target;
|
||||
_magazineCfg = configFile >> "CfgMagazines" >> _magazineType;
|
||||
if (getNumber (_magazineCfg >> "ACE_isBelt") == 1) exitWith {true};
|
||||
if (getNumber (configFile >> "CfgMagazines" >> currentMagazine _target >> "ACE_isBelt") == 1) exitWith {true};
|
||||
|
||||
// Check for rocket launchers
|
||||
if (currentWeapon _target == secondaryWeapon _target) exitWith {true};
|
||||
|
Loading…
Reference in New Issue
Block a user