mirror of
https://github.com/yquake2/rogue.git
synced 2025-02-16 17:11:02 +00:00
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:
parent
e4daf3c070
commit
325910d2fe
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue