mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-06-13 21:31:56 +03:00
Update vanilla fence building
Vanilla commits applied: https://github.com/DayZMod/DayZ/commit/e88a5c42bc86f91d254104b13064f83a2dd23a76 https://github.com/DayZMod/DayZ/commit/fe9564351108ae72496592b3bd741a5064b84ccd https://github.com/DayZMod/DayZ/commit/9a82b8307c523046773b9cd3440c387c7155d70e https://github.com/DayZMod/DayZ/commit/5a305198c70b1c3bdf7fbf055f550cf3a2d14001 https://github.com/DayZMod/DayZ/commit/be872601c96e526cb443b6ad47eb71fdf6618775 https://github.com/DayZMod/DayZ/commit/44a25b1b4a86d17ecf0780ba322513d756d1cbb1 https://github.com/DayZMod/DayZ/commit/7bfeab3c13b3835c5f134b39a15c8eae948a21b7 https://github.com/DayZMod/DayZ/commit/cc5f02a41ae7cba9d0312463caf48f46eed9cdad
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/***********************************************************
|
||||
ASSIGN DAMAGE TO A UNIT.
|
||||
Called by "HandleDamage" vehicle Event Handler
|
||||
|
||||
- Function fnc_Obj_FenceHandleDam
|
||||
- [unit] call fnc_Obj_FenceHandleDam;
|
||||
- return : 0 no damage
|
||||
************************************************************/
|
||||
private["_obj","_total","_damage"];
|
||||
|
||||
//Object the EH is assigned too
|
||||
_obj = _this select 0;
|
||||
//Total damage of the object
|
||||
_total = (damage _obj);
|
||||
|
||||
//Modify damage done based on level of fence
|
||||
_damage = switch (1==1) do {
|
||||
case ((typeof _obj) in ["WoodenFence_3","WoodenFence_4","WoodenFence_5","WoodenGate_2","WoodenGate_3"]): { 0.5 };
|
||||
case ((typeof _obj) in ["WoodenFence_6","WoodenFence_7","WoodenGate_4"]): { 0.35 };
|
||||
default { 1 };
|
||||
};
|
||||
|
||||
//Is the object local
|
||||
if (local _obj) then {
|
||||
//is damage being done aboue 0 (should always be) not needed.
|
||||
if (_damage > 0) then {
|
||||
//Server running or client
|
||||
if (!isServer) then {
|
||||
//If its a client send to server get the ownering player and send damage to that player
|
||||
PVDZ_veh_Save = [_obj,"objWallDamage",(_total + _damage)];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
} else {
|
||||
//Server running the EH, update object to db
|
||||
[_obj,"objWallDamage",(_total + _damage)] call server_updateObject;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
//send to server then back to owning client/server
|
||||
PVDZ_send = [_obj,"objWallDamage",_this];
|
||||
publicVariableServer "PVDZ_send";
|
||||
};
|
||||
|
||||
//Logging.
|
||||
diag_log format["INFO - %1(%3) - %2(%4)",_obj,_damage,(typeof _obj),_total];
|
||||
|
||||
|
||||
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
|
||||
0
|
||||
@@ -1,28 +0,0 @@
|
||||
/***********************************************************
|
||||
ASSIGN DAMAGE TO A UNIT.
|
||||
Called by "HandleDamage" vehicle Event Handler
|
||||
|
||||
- Function fnc_obj_handleDam
|
||||
- [unit, damage] call fnc_obj_handleDam;
|
||||
- return : updated damage
|
||||
************************************************************/
|
||||
private["_obj","_total","_damage"];
|
||||
|
||||
_obj = _this select 0;
|
||||
_damage = _this select 1;
|
||||
_total = (damage _obj);
|
||||
|
||||
if (_damage > 0) then {
|
||||
if (!isServer) then {
|
||||
PVDZ_veh_Save = [_obj,"objWallDamage",(_total + _damage)];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
} else {
|
||||
[_obj,"objWallDamage",(_total + _damage)] call server_updateObject;
|
||||
};
|
||||
};
|
||||
|
||||
//diag_log format["INFO - %1(%3) - %2(%4)",_obj,_damage,(typeof _obj),(_total + _damage)];
|
||||
|
||||
|
||||
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
|
||||
0
|
||||
Reference in New Issue
Block a user