Fix MPKilled mp evh call on client, add correct 0 return value for all HandleDamage evhs when godmode

This commit is contained in:
A Man
2022-04-18 10:22:42 +02:00
parent 2a1f36f55c
commit bec7ff8146
8 changed files with 11 additions and 11 deletions

View File

@@ -1580,7 +1580,7 @@ if (_canBuild) then {
};
};
if (DZE_GodModeBase && {!(_classname in DZE_GodModeBaseExclude)}) then {
_builtObject addEventHandler ["HandleDamage", {false}];
_builtObject addEventHandler ["HandleDamage", {0}];
};
} else { // if magazine was not removed, cancel publish
deleteVehicle _builtObject;

View File

@@ -110,7 +110,7 @@ if (count _upgrade > 0) then {
if (DZE_GodModeBase && {!(_classname in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage", {false}];
_object addEventHandler ["HandleDamage", {0}];
} else {
//

View File

@@ -188,7 +188,7 @@ if ((count _upgrade) > 0) then {
if (DZE_GodModeBase && {!(_classname in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage",{false}];
_object addEventHandler ["HandleDamage",{0}];
} else {
//

View File

@@ -10,7 +10,7 @@ _old removeAllEventHandlers "HandleDamage";
_old removeAllEventHandlers "Killed";
_old removeAllEventHandlers "Fired";
_old allowDamage false;
_old addEventHandler ["handleDamage", {0}];
_old addEventHandler ["HandleDamage", {0}];
//Logout
local _humanity = player getVariable ["humanity",0];
@@ -109,7 +109,7 @@ if (Z_SingleCurrency) then {
call dayz_resetSelfActions; //New unit has no self actions yet. Reset variables so actions can be added back.
dayz_actionInProgress = false; //Allow self actions to run now.
player removeAllEventHandlers "handleDamage";
player removeAllEventHandlers "HandleDamage";
eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;}];
[player] call fnc_usec_damageHandle;
player allowDamage true;

View File

@@ -70,7 +70,7 @@ _newUnit = _group createUnit [_class,respawn_west_original,[],0,"NONE"];
_newUnit allowDamage false;
if (_isArray) then {
mydamage_eh1 = _newUnit addEventHandler ["handleDamage", {0}];
mydamage_eh1 = _newUnit addEventHandler ["HandleDamage", {0}];
_newUnit setVariable ["characterID",(_this select 1),true];
_newUnit setVariable ["humanity",(_this select 2),true];
_newUnit setVariable ["zombieKills",(_this select 3),true];

View File

@@ -53,7 +53,7 @@ if (_outcome != "PASS") then {
_object setPos _location;
};
_object addEventHandler ["HandleDamage",{false}];
_object addEventHandler ["HandleDamage",{0}];
clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object;

View File

@@ -31,9 +31,9 @@ if ([_object, "Server"] call check_publishobject) then {
if !(_object isKindOf "TrapItems") then {
if (DZE_GodModeBase && {!(_type in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage", {false}];
_object addEventHandler ["HandleDamage", {0}];
} else {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
_object addMPEventHandler ["MPKilled",{if !(isServer) exitWith {};_this call vehicle_handleServerKilled;}];
};
};
// Test disabling simulation server side on buildables only.

View File

@@ -85,9 +85,9 @@ _object setVariable ["lastUpdate",diag_tickTime];
_object setVariable ["ObjectUID", _uid];
if (DZE_GodModeBase && {!(_class in DZE_GodModeBaseExclude)}) then {
_object addEventHandler ["HandleDamage",{false}];
_object addEventHandler ["HandleDamage",{0}];
} else {
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];
_object addMPEventHandler ["MPKilled",{if !(isServer) exitWith {};_this call vehicle_handleServerKilled;}];
};
_gearClasses = ["Wooden_shed2_DZ","WoodShack2_DZ","StorageShed2_DZ","GunRack2_DZ","WoodCrate2_DZ","TentStorage0","TentStorage1","TentStorage2","TentStorage3","TentStorage4","DomeTentStorage0","DomeTentStorage1","DomeTentStorage2","DomeTentStorage3","DomeTentStorage4","DesertTentStorage0","DesertTentStorage1","DesertTentStorage2","DesertTentStorage3","DesertTentStorage4","StashSmall1","StashSmall2","StashSmall3","StashSmall4","StashMedium","StashMedium1","StashMedium2","StashMedium3","StashMedium4","TentStorageWinter0","TentStorageWinter1","TentStorageWinter2","TentStorageWinter3","TentStorageWinter4","WinterDomeTentStorage0","WinterDomeTentStorage1","WinterDomeTentStorage2","WinterDomeTentStorage3","WinterDomeTentStorage4"];