Make sure that the entity to printes is valid.

Especially after savegame load not all slots in the edicts array may be
used. Check if the current entity has a classname string. This is
another part of yquake2/yquake2#430.
This commit is contained in:
Yamagi Burmeister 2019-09-07 14:26:42 +02:00
parent e4daf3c070
commit 325910d2fe

View file

@ -1377,6 +1377,12 @@ Cmd_ListEntities_f(edict_t *ent)
edict_t *cur = &g_edicts[i];
qboolean print = false;
/* Ensure that the entity is valid. */
if (!cur->classname)
{
continue;
}
if (all)
{
print = true;