Skip to content

Commit

Permalink
SPAWN: Better k_spm_custom_model compatibility.
Browse files Browse the repository at this point in the history
nquake-sv has had a comment that mentions values 0,1,2 to select
model, and the original mapping was 0 and >0, this makes the new
selection compatible with that and doesn't break existing configs.
  • Loading branch information
dsvensson committed Nov 22, 2024
1 parent c8395d7 commit 006760e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/items.c
Original file line number Diff line number Diff line change
Expand Up @@ -2875,13 +2875,9 @@ char *Spawn_GetModel(void)
if (!spawn_model[0])
{
char *mdl = cvar_string("k_spm_custom_model");
if (!strcmp(mdl, "0") || strlen(mdl) == 0)
if (only_digits(mdl))
{
strlcpy(spawn_model, "progs/w_g_key.mdl", sizeof(spawn_model));
}
else if (!strcmp(mdl, "1"))
{
strlcpy(spawn_model, "progs/wizard.mdl", sizeof(spawn_model));
strlcpy(spawn_model, atoi(mdl) ? "progs/wizard.mdl" : "progs/w_g_key.mdl", sizeof(spawn_model));
}
else
{
Expand Down

0 comments on commit 006760e

Please sign in to comment.