mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
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:
@@ -1,11 +1,13 @@
|
||||
private ["_part","_cancel","_color","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_damagePercent","_configVeh","_hitpoint","_hits"];
|
||||
|
||||
_vehicle = _this select 3;
|
||||
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
|
||||
dayz_myCursorTarget = _vehicle;
|
||||
|
||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
|
||||
if (count _hitpoints < 1) exitwith {};
|
||||
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
|
||||
|
||||
{
|
||||
_hitpoint = _x;
|
||||
_hits = [_vehicle,_hitpoint] call object_getHit;
|
||||
@@ -49,9 +51,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
|
||||
} count _hitpoints;
|
||||
|
||||
if (count _hitpoints > 0) then {
|
||||
// Localized in A2OA\Expansion\dta\languagecore
|
||||
_cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false];
|
||||
s_player_repairActions set [count s_player_repairActions,_cancel];
|
||||
s_player_repair_crtl = 1;
|
||||
};
|
||||
// Localized in A2OA\Expansion\dta\languagecore
|
||||
_cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false];
|
||||
s_player_repairActions set [count s_player_repairActions,_cancel];
|
||||
s_player_repair_crtl = 1;
|
||||
@@ -2,7 +2,6 @@ private ["_isMotorcycle","_hits","_part","_color","_vehicle","_PlayerNear","_hit
|
||||
"_6WheelTypeArray","_NoGlassArray","_RemovedPartsArray","_damage","_cmpt","_configVeh","_damagePercent","_string","_handle","_cancel","_type"];
|
||||
|
||||
_vehicle = _this select 3;
|
||||
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
|
||||
|
||||
_PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase", 12]) > 1;
|
||||
if (_PlayerNear) exitWith {dayz_myCursorTarget = objNull; localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||
@@ -10,6 +9,9 @@ if (_PlayerNear) exitWith {dayz_myCursorTarget = objNull; localize "str_pickup_l
|
||||
dayz_myCursorTarget = _vehicle;
|
||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
|
||||
if (count _hitpoints < 1) exitwith {};
|
||||
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
|
||||
|
||||
_type = typeOf _vehicle;
|
||||
_isMotorcycle = _vehicle isKindOf "Motorcycle";
|
||||
_is6WheelType = false;
|
||||
@@ -25,7 +27,7 @@ _NoGlassArray = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","Hi
|
||||
_RemovedPartsArray = ["motor","HitLF2Wheel","HitRF2Wheel","HitBody","HitMissiles","HitHull","HitVRotor","HitFuel","HitEngine"];
|
||||
|
||||
if (!_is6WheelType) then {
|
||||
if ((_vehicle isKindOf "ATV_Base_EP1") || {_isMotorcycle}) then {
|
||||
if ((_vehicle isKindOf "ATV_Base_EP1") || _isMotorcycle) then {
|
||||
_hitpoints = _hitpoints - _NoGlassArray;
|
||||
|
||||
if (_isMotorcycle) then {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user