diff --git a/src/d_net.c b/src/d_net.c index 7dd8f3478..60a423ffa 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -718,6 +718,12 @@ void Net_CloseConnection(INT32 node) if (!node) return; + if (node < 0 || 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; // try to Send ack back (two army problem) diff --git a/src/p_enemy.c b/src/p_enemy.c index d4d6064e3..4b8d14170 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1145,7 +1145,7 @@ void A_JetJawChomp(mobj_t *actor) if (!actor->target || !(actor->target->flags & MF_SHOOTABLE) || actor->target->health <= 0 || !P_CheckSight(actor, actor->target)) { - P_SetMobjState(actor, actor->info->spawnstate); + P_SetMobjStateNF(actor, actor->info->spawnstate); return; }