This commit is contained in:
Nicolás Badano 2015-03-24 00:57:03 -03:00
parent 58ea333b42
commit bc0dae63ca
2 changed files with 23 additions and 1 deletions

View File

@ -15,7 +15,17 @@ EXPLODE_2_PVT(_this,_player,_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 {
(currentMagazine _target) != ""
if (currentMagazine _target != "") exitWith {true};
private ["_magazines","_found"];
_magazines = magazinesAmmoFull _target;
_found = false;
{
if (_x select 2) exitWith {
_found = true;
};
} forEach _magazines;
_found
};
// Return false for all other vehicles

View File

@ -28,8 +28,20 @@ if (_target isKindOf "StaticWeapon") then {
_muzzle = _weapon;
};
};
if (_magazine == "") then {
// Try to get magazine using magazinesAmmoFull
private ["_magazines"];
_magazines = magazinesAmmoFull _target;
{
if (_x select 2) exitWith {
_magazine = _x select 0;
};
} forEach _magazines;
};
};
if (_magazine == "") exitWith {};
if (_weapon == "") exitWith {};
if (typeName _muzzle != "STRING") then {_muzzle = _weapon};