Skip to content

Commit bcb83c8

Browse files
committed
* FIX: [xrGame] crash on exit any mp mode due to calling missing scripts
1 parent fd551c1 commit bcb83c8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/xrGame/Level_network.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,17 @@ void CLevel::net_Stop()
152152
if (!IsGameTypeSingle())
153153
{
154154
luabind::functor<void> funct;
155-
R_ASSERT(GEnv.ScriptEngine->functor("mp_disconnect.before_remove_objects", funct));
156-
funct();
155+
if (GEnv.ScriptEngine->functor("mp_disconnect.before_remove_objects", funct))
156+
funct();
157157
}
158158

159159
remove_objects();
160160

161161
if (!IsGameTypeSingle())
162162
{
163163
luabind::functor<void> funct2;
164-
R_ASSERT(GEnv.ScriptEngine->functor("mp_disconnect.after_remove_objects", funct2));
165-
funct2();
164+
if (GEnv.ScriptEngine->functor("mp_disconnect.after_remove_objects", funct2))
165+
funct2();
166166
}
167167

168168
// WARNING ! remove_objects() uses this flag, so position of this line must e here ..
@@ -429,24 +429,24 @@ bool CLevel::Connect2Server(const char* options)
429429

430430
Msg ("%c client : connection %s - <%s>", m_bConnectResult ?'*':'!', m_bConnectResult ? "accepted" : "rejected", m_sConnectResult.c_str());
431431

432-
if(!m_bConnectResult)
432+
if(!m_bConnectResult)
433433
{
434434
if(Server)
435435
{
436436
Server->Disconnect ();
437437
xr_delete (Server);
438438
}
439-
OnConnectRejected ();
439+
OnConnectRejected ();
440440
Disconnect ();
441441
return FALSE ;
442442
};
443-
443+
444444
if (psNET_direct_connect)
445445
net_Syncronised = TRUE;
446446
else
447447
net_Syncronize(); // parallel
448448

449-
while (!net_IsSyncronised())
449+
while (!net_IsSyncronised())
450450
{
451451
Sleep(1);
452452
if (net_Disconnected)

0 commit comments

Comments
 (0)