Handle RHS impact grenades (RGN/RGO) (#4447)

This commit is contained in:
PabstMirror 2016-09-23 16:38:24 -05:00 committed by GitHub
parent d1e15110b3
commit a7c75a3bf6
2 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,12 @@ private _muzzle = _unit getVariable [QGVAR(activeMuzzle), ""];
// Set muzzle ammo to 0 to block vanilla throwing (can only be 0 or 1), removeItem above resets it
_unit setAmmo [_muzzle, 0];
// Handle weird scripted grenades (RHS) which could cause unexpected behaviour
private _nonInheritedCfg = configProperties [configFile >> "CfgAmmo" >> _throwableType, 'configName _x == QGVAR(replaceWith)', false];
if ((count _nonInheritedCfg) == 1) then {
_throwableType = getText (_nonInheritedCfg select 0);
};
// Create actual throwable globally
private _activeThrowableOld = _unit getVariable [QGVAR(activeThrowable), objNull];
private _activeThrowable = createVehicle [_throwableType, _activeThrowableOld, [], 0, "CAN_COLLIDE"];

View File

@ -163,6 +163,8 @@ class CfgAmmo {
ace_frag_force = 1;
};
class rhs_ammo_rgn: rhs_ammo_rgn_base {
// RGN is scripted grenade that deletes itself, which will break advanced throwing, replace with it's base
ace_advanced_throwing_replaceWith = "rhs_ammo_rgn_base";
ace_frag_enabled = 0;
ace_frag_skip = 1;
ace_frag_force = 0;