mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 04:23:13 +03:00
Update compiles - 2 more files to do
fn_selfActions.sqf player_updateGui.sqf
This commit is contained in:
28
SQF/dayz_code/compile/obj_handleDam.sqf
Normal file
28
SQF/dayz_code/compile/obj_handleDam.sqf
Normal file
@@ -0,0 +1,28 @@
|
||||
/***********************************************************
|
||||
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","_currentDamage"];
|
||||
|
||||
_obj = _this select 0;
|
||||
_damage = _this select 2;
|
||||
_total = (damage _obj);
|
||||
|
||||
if (_damage > 0) then {
|
||||
_total = (damage _obj) + _damage;
|
||||
|
||||
if (!isServer) then {
|
||||
PVDZ_obj_Save = [_obj,"objWallDamage",_total];
|
||||
publicVariableServer "PVDZ_obj_Save";
|
||||
} else {
|
||||
[_obj,"objWallDamage",_total] call server_updateObject;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
|
||||
_total
|
||||
Reference in New Issue
Block a user