mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-19 01:52:00 +03:00
private array updates + fixes
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
/*
|
||||
[_object,_type] spawn server_updateObject;
|
||||
*/
|
||||
private ["_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk","_counter","_removeCounter","_parachuteWest","_firstTime","_object_killed","_object_repair"];
|
||||
private ["_object","_type","_objectID","_uid","_lastUpdate","_needUpdate","_object_position","_object_inventory","_object_damage","_isNotOk","_parachuteWest","_firstTime","_object_killed","_object_repair","_isbuildable"];
|
||||
|
||||
_object = _this select 0;
|
||||
_type = _this select 1;
|
||||
_parachuteWest = typeOf _object == "ParachuteWest";
|
||||
_isbuildable = (typeOf _object) in dayz_allowedObjects;
|
||||
_isNotOk = false;
|
||||
_firstTime = false;
|
||||
|
||||
_removeCounter = 0;
|
||||
|
||||
_objectID = _object getVariable ["ObjectID","0"];
|
||||
_uid = _object getVariable ["ObjectUID","0"];
|
||||
|
||||
@@ -26,17 +25,14 @@ if (!_parachuteWest) then {
|
||||
{
|
||||
_object_position = getPosATL _object;
|
||||
_isNotOk = true;
|
||||
|
||||
// Loop to wait it out
|
||||
_counter = _object getVariable ["markedForRemoval",0];
|
||||
|
||||
_removeCounter = _counter + 1;
|
||||
_object setVariable ["markedForRemoval",(_counter + 1)];
|
||||
};
|
||||
};
|
||||
|
||||
if (_isNotOk and _removeCounter < 10) exitWith { diag_log(format["About to remove vehicle: %1 - %2 / 10", typeOf _object, _removeCounter]); };
|
||||
if (_isNotOk and _removeCounter >= 10) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); };
|
||||
// do not update if buildable and not ok
|
||||
if (_isNotOk and _isbuildable) exitWith { };
|
||||
|
||||
// delete if still not ok
|
||||
if (_isNotOk) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); };
|
||||
|
||||
|
||||
_lastUpdate = _object getVariable ["lastUpdate",time];
|
||||
|
||||
Reference in New Issue
Block a user