mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix crash when enabling dbg_dummies
on running server
The server normally needs to be reloaded to spawn the debug dummies, so this code was not checking if a debug dummy player exists. Decreasing the number of debug dummies while the server is running also causes them to simply not be snapped instead of completely destroying them.
This commit is contained in:
parent
a5f94ecf80
commit
4c80af7bd9
|
@ -1204,9 +1204,12 @@ void CGameContext::OnTick()
|
|||
{
|
||||
for(int i = 0; i < g_Config.m_DbgDummies; i++)
|
||||
{
|
||||
CNetObj_PlayerInput Input = {0};
|
||||
Input.m_Direction = (i & 1) ? -1 : 1;
|
||||
m_apPlayers[MAX_CLIENTS - i - 1]->OnPredictedInput(&Input);
|
||||
if(m_apPlayers[MAX_CLIENTS - i - 1])
|
||||
{
|
||||
CNetObj_PlayerInput Input = {0};
|
||||
Input.m_Direction = (i & 1) ? -1 : 1;
|
||||
m_apPlayers[MAX_CLIENTS - i - 1]->OnPredictedInput(&Input);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue