Fix rpt errors if zombies hit players inside gyros

Also zombies can punch players out of gyros now. The same way like bikes and ATVs.
This commit is contained in:
AirwavesMan
2021-03-01 15:23:57 +01:00
parent d55269c1e2
commit fd6bfbbff5
3 changed files with 19 additions and 15 deletions

View File

@@ -117,14 +117,10 @@ _zPos = getPosASL _unit;
// compute damage for vehicle and/or the player
if (_isVehicle) then {
if ((_unit distance player) < (3.3 * 2)) then {
_hpList = _vehicle call vehicle_getHitpoints;
_hp = _hpList call BIS_fnc_selectRandom;
_wound = getText(configFile >> "cfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _hp >> "name");
_damage = random 0.08;
_chance = round(random 12);
_chance = round(random 12);
if ((_chance % 4) == 0) then {
_openVehicles = ["ATV_Base_EP1", "Motorcycle", "Bicycle"];
_openVehicles = ["ATV_Base_EP1", "Motorcycle", "Bicycle", "CSJ_GyroP", "CSJ_GyroC"];
{
if (_vehicle isKindOf _x) exitWith {
player action ["eject", _vehicle];
@@ -132,6 +128,12 @@ if (_isVehicle) then {
} count _openVehicles;
};
_hpList = _vehicle call vehicle_getHitpoints;
if (count _hpList < 1) exitwith {};
_hp = _hpList call BIS_fnc_selectRandom;
_wound = getText(configFile >> "cfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _hp >> "name");
_damage = random 0.08;
if (_wound in [ "glass1", "glass2", "glass3", "glass4", "glass5", "glass6" ]) then {
_dam = _vehicle getHit _wound;
_total = (_dam + _damage);