mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-05-15 15:13:22 +03:00
private array updates + fixes
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
private["_isOK","_object","_worldspace","_location","_dir","_character","_tent","_class","_id","_uid","_dam","_hitpoints","_selection","_array","_damage","_randFuel","_fuel","_key","_result","_outcome","_totaldam","_parts","_retry","_done","_spawnDMG"];
|
||||
private ["_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID"];
|
||||
|
||||
_object = _this select 0;
|
||||
_worldspace = _this select 1;
|
||||
_class = _this select 2;
|
||||
_spawnDMG = _this select 3;
|
||||
// _spawnDMG = _this select 3;
|
||||
_keySelected = _this select 4;
|
||||
|
||||
_isOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
@@ -27,13 +27,13 @@ _key call server_hiveWrite;
|
||||
|
||||
// Switched to spawn so we can wait a bit for the ID
|
||||
[_object,_uid,_characterID,_class,_dir,_location] spawn {
|
||||
private["_object","_uid","_characterID","_done","_retry","_key","_result","_outcome","_oid","_selection","_dam","_class"];
|
||||
private ["_object","_uid","_characterID","_done","_retry","_key","_result","_outcome","_oid","_class","_location","_object_para"];
|
||||
|
||||
_object = _this select 0;
|
||||
_uid = _this select 1;
|
||||
_characterID = _this select 2;
|
||||
_class = _this select 3;
|
||||
_dir = _this select 4;
|
||||
//_dir = _this select 4;
|
||||
_location = _this select 5;
|
||||
|
||||
_done = false;
|
||||
|
||||
@@ -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