mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-21 00:41:05 +00:00
Make sure that the entity to be printed 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 #430.
This commit is contained in:
parent
c41f61f8fb
commit
90c2ac8946
1 changed files with 6 additions and 0 deletions
|
@ -1339,6 +1339,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