Assuming the SVQC program is always running crashes when it's not.
Testing if the edict pointer is NULL isn't a valid way to stop at the
end of the client slots, which caused this to crash when Xonotic SVQC
was running.
See
1814b2df58302baa47df6718b09465265dfc7e5c
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
static void SV_DisableCheats_c(cvar_t *var)
{
prvm_prog_t *prog = SVVM_prog;
- int i = 0;
+ int i;
- if (var->value == 0)
+ if (prog->loaded && var->value == 0)
{
- while (svs.clients[i].edict)
+ for (i = 0; i < svs.maxclients; ++i)
{
if (((int)PRVM_serveredictfloat(svs.clients[i].edict, flags) & FL_GODMODE))
PRVM_serveredictfloat(svs.clients[i].edict, flags) = (int)PRVM_serveredictfloat(svs.clients[i].edict, flags) ^ FL_GODMODE;
noclip_anglehack = false;
PRVM_serveredictfloat(svs.clients[i].edict, movetype) = MOVETYPE_WALK;
}
- i++;
}
}
}