mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
prevent invalid nodes from crashing Net_CloseConnection, print a warning and return instead
This commit is contained in:
parent
4008cae507
commit
8582406dd2
1 changed files with 6 additions and 0 deletions
|
@ -716,6 +716,12 @@ void Net_CloseConnection(INT32 node)
|
||||||
if (!node)
|
if (!node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (node >= MAXNETNODES) // prevent invalid nodes from crashing the game
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_WARNING, M_GetText("Net_CloseConnection: invalid node %d detected!\n"), node);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nodes[node].flags |= NF_CLOSE;
|
nodes[node].flags |= NF_CLOSE;
|
||||||
|
|
||||||
// try to Send ack back (two army problem)
|
// try to Send ack back (two army problem)
|
||||||
|
|
Loading…
Reference in a new issue