mirror of
https://github.com/yquake2/xatrix.git
synced 2025-06-02 01:51:14 +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
6dfe39ba23
commit
cfb3e7abf0
1 changed files with 6 additions and 0 deletions
|
@ -1368,6 +1368,12 @@ Cmd_ListEntities_f(edict_t *ent)
|
||||||
edict_t *cur = &g_edicts[i];
|
edict_t *cur = &g_edicts[i];
|
||||||
qboolean print = false;
|
qboolean print = false;
|
||||||
|
|
||||||
|
/* Ensure that the entity is valid. */
|
||||||
|
if (!cur->classname)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (all)
|
if (all)
|
||||||
{
|
{
|
||||||
print = true;
|
print = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue