Skip to content

Commit 7309acb

Browse files
Trying to make workaround for xrGame CTD.
Also enabled autosave.
1 parent f517280 commit 7309acb

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

src/xrGame/Entity.cpp

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,44 @@ DLL_Pure *CEntity::_construct ()
322322

323323
const u32 FORGET_KILLER_TIME = 180000;
324324

325-
void CEntity::shedule_Update (u32 dt)
325+
void CEntity::shedule_Update(u32 dt)
326326
{
327-
inherited::shedule_Update (dt);
328-
if (!getDestroy() && !g_Alive() && (m_killer_id != u16(-1))) {
329-
if (Device.dwTimeGlobal > m_level_death_time + FORGET_KILLER_TIME) {
330-
m_killer_id = u16(-1);
331-
NET_Packet P;
332-
u_EventGen (P,GE_ASSIGN_KILLER,ID());
333-
P.w_u16 (u16(-1));
334-
if (IsGameTypeSingle()) u_EventSend (P);
327+
inherited::shedule_Update(dt);
328+
BOOL lDestroy = TRUE;
329+
BOOL lAlive = TRUE;
330+
BOOL lKillerId = TRUE;
331+
try {
332+
lDestroy = getDestroy();
333+
}
334+
catch (std::exception& e) {
335+
Msg("RELEASE CONFIGURATION FIX: lDestroy failed");
336+
}
337+
try {
338+
lAlive = g_Alive();
339+
}
340+
catch (std::exception& e) {
341+
Msg("RELEASE CONFIGURATION FIX: lAlive failed");
342+
}
343+
try {
344+
lKillerId = m_killer_id != u16(-1);
345+
}
346+
catch (std::exception& e) {
347+
Msg("RELEASE CONFIGURATION FIX: lKillerId failed");
348+
}
349+
try {
350+
if (!lDestroy && !lAlive && lKillerId) {
351+
if (Device.dwTimeGlobal > m_level_death_time + FORGET_KILLER_TIME) {
352+
m_killer_id = u16(-1);
353+
NET_Packet P;
354+
u_EventGen(P, GE_ASSIGN_KILLER, ID());
355+
P.w_u16(u16(-1));
356+
if (IsGameTypeSingle()) u_EventSend(P);
357+
}
335358
}
336359
}
360+
catch (std::exception& e) {
361+
Msg("RELEASE CONFIGURATION FIX: if block failed");
362+
}
337363
}
338364

339365
void CEntity::on_before_change_team ()

src/xrGame/autosave_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ float CAutosaveManager::shedule_Scale ()
5050
void CAutosaveManager::shedule_Update (u32 dt)
5151
{
5252
inherited::shedule_Update (dt);
53-
#pragma todo("Plecha to Plecha : AUTOSAVE (do not forgive to enable it in release version:-))))!!!!")
54-
if (true) return;
53+
//#pragma todo("Plecha to Plecha : AUTOSAVE (do not forgive to enable it in release version:-))))!!!!")
54+
//if (true) return;
5555
if (!ai().get_alife())
5656
return;
5757

0 commit comments

Comments
 (0)