mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Shorten some isKindOf checks
This commit is contained in:
@@ -165,7 +165,7 @@ if (_unit == player) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//(vehicle _source != _source) does not work to detect if source unit is in a vehicle in HandleDamage EH
|
//(vehicle _source != _source) does not work to detect if source unit is in a vehicle in HandleDamage EH
|
||||||
_isVehicle = (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship");
|
_isVehicle = ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0);
|
||||||
|
|
||||||
//Log to server. Useful for detecting damage and ammo cheats.
|
//Log to server. Useful for detecting damage and ammo cheats.
|
||||||
if (DZE_ServerLogHits && {!_isLocal} && {!_isZombieHit} && {_isMan or _isVehicle} && {diag_ticktime-(_source getVariable["lastloghit",0]) > 2}) then {
|
if (DZE_ServerLogHits && {!_isLocal} && {!_isZombieHit} && {_isMan or _isVehicle} && {diag_ticktime-(_source getVariable["lastloghit",0]) > 2}) then {
|
||||||
@@ -206,8 +206,8 @@ if (_hit == "" && _ammo != "Crash") exitWith { 0 };
|
|||||||
|
|
||||||
//Ammo Type Setup
|
//Ammo Type Setup
|
||||||
_type = switch true do {
|
_type = switch true do {
|
||||||
case ((_ammo isKindof "Grenade") or (_ammo isKindof "ShellBase") or (_ammo isKindof "TimeBombCore") or (_ammo isKindof "BombCore") or (_ammo isKindof "MissileCore") or (_ammo isKindof "RocketCore") or (_ammo isKindof "FuelExplosion") or (_ammo isKindof "GrenadeBase")): { 1 };
|
case ({_ammo isKindOf _x} count ["Grenade","ShellBase","TimeBombCore","BombCore","MissileCore","RocketCore","FuelExplosion","GrenadeBase"] > 0): { 1 };
|
||||||
case ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")): { 2 };
|
case ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")): { 2 };
|
||||||
case (_isZombieHit): { 3 };
|
case (_isZombieHit): { 3 };
|
||||||
case (_ammo == "RunOver"): { 4 };
|
case (_ammo == "RunOver"): { 4 };
|
||||||
case (_ammo == "Dragged"): { 5 };
|
case (_ammo == "Dragged"): { 5 };
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ if (!isNull _source) then {
|
|||||||
_sourceWeapon = currentWeapon _source;
|
_sourceWeapon = currentWeapon _source;
|
||||||
_sourceWeapon = switch true do {
|
_sourceWeapon = switch true do {
|
||||||
case (_ammo in ["PipeBomb","Mine","MineE"]): {_ammo};
|
case (_ammo in ["PipeBomb","Mine","MineE"]): {_ammo};
|
||||||
case (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship"): {_sourceVehicleType};
|
case ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0): {_sourceVehicleType};
|
||||||
case (_sourceWeapon == "Throw"): {(weaponState _source) select 3};
|
case (_sourceWeapon == "Throw"): {(weaponState _source) select 3};
|
||||||
default {_sourceWeapon};
|
default {_sourceWeapon};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if (!DZE_NoVehicleExplosions) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_isVeh = (_v iskindof "helicopter" || _v iskindof "plane" || _v iskindof "tank" || _v iskindof "car" || _v iskindof "ship");
|
_isVeh = ({_v isKindOf _x} count ["Helicopter","Plane","Tank","Car","Ship"] > 0);
|
||||||
if (_isVeh && {player in (crew _v)}) then {
|
if (_isVeh && {player in (crew _v)}) then {
|
||||||
["Eject", _v] call BIS_Effects_globalEvent;
|
["Eject", _v] call BIS_Effects_globalEvent;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user