fixes, added isnull check to reduce obj not found log spam

This commit is contained in:
[VB]AWOL
2013-12-09 08:04:50 -06:00
parent 1078440552
commit bb2c2df88b

View File

@@ -598,7 +598,7 @@ dayz_recordLogin = {
}; };
dayz_perform_purge = { dayz_perform_purge = {
if(!isNull(_this)) then {
_this removeAllMPEventHandlers "mpkilled"; _this removeAllMPEventHandlers "mpkilled";
_this removeAllMPEventHandlers "mphit"; _this removeAllMPEventHandlers "mphit";
_this removeAllMPEventHandlers "mprespawn"; _this removeAllMPEventHandlers "mprespawn";
@@ -612,7 +612,7 @@ dayz_perform_purge = {
clearVehicleInit _this; clearVehicleInit _this;
deleteVehicle _this; deleteVehicle _this;
deleteGroup (group _this); deleteGroup (group _this);
// _this = nil; };
}; };
dayz_perform_purge_player = { dayz_perform_purge_player = {
@@ -620,6 +620,8 @@ dayz_perform_purge_player = {
private ["_countr","_backpack","_backpackType","_backpackWpn","_backpackMag","_objWpnTypes","_objWpnQty","_location","_dir","_holder","_weapons","_magazines"]; private ["_countr","_backpack","_backpackType","_backpackWpn","_backpackMag","_objWpnTypes","_objWpnQty","_location","_dir","_holder","_weapons","_magazines"];
diag_log ("Purging player: " + str(_this)); diag_log ("Purging player: " + str(_this));
if(!isNull(_this)) then {
_location = getPosATL _this; _location = getPosATL _this;
_dir = getDir _this; _dir = getDir _this;
@@ -659,6 +661,7 @@ dayz_perform_purge_player = {
_countr = _countr + 1; _countr = _countr + 1;
} forEach _objWpnTypes; } forEach _objWpnTypes;
}; };
};
// add weapons // add weapons
{ {
@@ -688,10 +691,12 @@ dayz_perform_purge_player = {
dayz_removePlayerOnDisconnect = { dayz_removePlayerOnDisconnect = {
if(!isNull(_this)) then {
_this removeAllMPEventHandlers "mphit"; _this removeAllMPEventHandlers "mphit";
deleteVehicle _this; deleteVehicle _this;
deleteGroup (group _this); deleteGroup (group _this);
}; };
};
server_timeSync = { server_timeSync = {
//Send request //Send request
@@ -778,7 +783,7 @@ server_spawnCleanNull = {
server_spawnCleanFire = { server_spawnCleanFire = {
private ["_delQtyFP","_qty","_delQtyNull","_missionFires"]; private ["_delQtyFP","_qty","_delQtyNull","_missionFires"];
_missionFires = entities "Land_Fire_DZ"; _missionFires = allMissionObjects "Land_Fire_DZ";
_delQtyFP = 0; _delQtyFP = 0;
{ {
if (local _x) then { if (local _x) then {
@@ -793,13 +798,12 @@ server_spawnCleanFire = {
diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyNull,_qty]); diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyNull,_qty]);
}; };
}; };
server_spawnCleanLoot = { server_spawnCleanLoot = {
private ["_created","_delQty","_nearby","_age","_keep","_qty","_missionObjs","_dateNow"]; private ["_created","_delQty","_nearby","_age","_keep","_qty","_missionObjs","_dateNow"];
if(!isNil "DZE_DYN_cleanLoot") exitWith { }; if(!isNil "DZE_DYN_cleanLoot") exitWith { };
DZE_DYN_cleanLoot = true; DZE_DYN_cleanLoot = true;
_missionObjs = entities "ReammoBox"; _missionObjs = allMissionObjects "ReammoBox";
_delQty = 0; _delQty = 0;
_dateNow = (DateToNumber date); _dateNow = (DateToNumber date);
{ {
@@ -833,7 +837,7 @@ server_spawnCleanLoot = {
server_spawnCleanAnimals = { server_spawnCleanAnimals = {
private ["_pos","_delQtyAnimal","_qty","_missonAnimals","_nearby"]; private ["_pos","_delQtyAnimal","_qty","_missonAnimals","_nearby"];
if(!isNil "DZE_DYN_cleanAnimals") exitWith { }; if(!isNil "DZE_DYN_cleanAnimals") exitWith { };
DZE_DYN_cleanLoot = true; DZE_DYN_cleanAnimals = true;
_missonAnimals = entities "CAAnimalBase"; _missonAnimals = entities "CAAnimalBase";
_delQtyAnimal = 0; _delQtyAnimal = 0;
{ {
@@ -860,5 +864,5 @@ server_spawnCleanAnimals = {
_qty = count _missonAnimals; _qty = count _missonAnimals;
diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]); diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]);
}; };
DZE_DYN_cleanLoot = nil; DZE_DYN_cleanAnimals = nil;
}; };