mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Should fix flies spawning where player relogs
AI mods will need to setVariable "bodyName" on their dead units to prevent them being cleaned up.
This commit is contained in:
@@ -26,20 +26,22 @@ sched_co_deleteVehicle = {
|
|||||||
|
|
||||||
|
|
||||||
sched_corpses = {
|
sched_corpses = {
|
||||||
private ["_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal","_sound","_deathPos","_cpos","_animal","_nearPlayer"];
|
private ["_delQtyG","_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal","_sound","_deathPos","_cpos","_animal","_nearPlayer"];
|
||||||
// EVERY 2 MINUTE
|
// EVERY 2 MINUTE
|
||||||
// DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES
|
// DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES
|
||||||
_delQtyZ = 0;
|
_delQtyZ = 0;
|
||||||
_delQtyP = 0;
|
_delQtyP = 0;
|
||||||
|
_delQtyG = 0;
|
||||||
_addFlies = 0;
|
_addFlies = 0;
|
||||||
// diag_log "bodies ...";
|
|
||||||
{
|
{
|
||||||
if (local _x) then {
|
if (local _x) then {
|
||||||
if (_x isKindOf "zZombie_Base") then {
|
if (_x isKindOf "zZombie_Base") then {
|
||||||
_x call sched_co_deleteVehicle;
|
_x call sched_co_deleteVehicle;
|
||||||
_delQtyZ = _delQtyZ + 1;
|
_delQtyZ = _delQtyZ + 1;
|
||||||
} else {
|
} else {
|
||||||
if (_x isKindOf "CAManBase") then {
|
//Only spawn flies on actual dead player, otherwise delete the body (clean up left over ghost from relogging, sometimes it is not deleted automatically by Arma or onPlayerDisconnect)
|
||||||
|
//AI mods will need to setVariable "bodyName" on their dead units to prevent them being cleaned up
|
||||||
|
if (_x getVariable["bodyName",""] != "") then {
|
||||||
_deathTime = _x getVariable ["sched_co_deathTime", -1];
|
_deathTime = _x getVariable ["sched_co_deathTime", -1];
|
||||||
if (_deathTime == -1) then {
|
if (_deathTime == -1) then {
|
||||||
_deathPos = _x getVariable [ "deathPos", getMarkerPos "respawn_west" ];
|
_deathPos = _x getVariable [ "deathPos", getMarkerPos "respawn_west" ];
|
||||||
@@ -98,6 +100,9 @@ sched_corpses = {
|
|||||||
PVCDZ_flies = [ _onoff, _x ];
|
PVCDZ_flies = [ _onoff, _x ];
|
||||||
publicVariable "PVCDZ_flies";
|
publicVariable "PVCDZ_flies";
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
_x call sched_co_deleteVehicle;
|
||||||
|
_delQtyG = _delQtyG + 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -124,9 +129,9 @@ sched_corpses = {
|
|||||||
} forEach allGroups;
|
} forEach allGroups;
|
||||||
|
|
||||||
#ifdef SERVER_DEBUG
|
#ifdef SERVER_DEBUG
|
||||||
if (_delQtyZ+_delQtyP+_addFlies+_delQtyGrp > 0) then {
|
if (_delQtyZ+_delQtyP+_addFlies+_delQtyGrp+_delQtyG > 0) then {
|
||||||
diag_log format ["%1: Deleted %2 uncontrolled zombies, %3 uncontrolled animals, %4 dead character bodies and %5 empty groups. Added %6 flies.", __FILE__,
|
diag_log format ["%1: Deleted %2 uncontrolled zombies, %3 uncontrolled animals, %4 dead character bodies, %7 ghosts and %5 empty groups. Added %6 flies.",__FILE__,
|
||||||
_delQtyZ, _delQtyAnimal, _delQtyP,_delQtyGrp, _addFlies ];
|
_delQtyZ,_delQtyAnimal,_delQtyP,_delQtyGrp,_addFlies,_delQtyG];
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user