Update gametype_cons_t on gametype name changes

This commit is contained in:
Lactozilla 2023-08-05 02:50:54 -03:00
parent f38f568b2d
commit 52da591622
2 changed files with 1 additions and 5 deletions

View file

@ -3569,11 +3569,6 @@ void G_AddGametypeConstant(INT16 gtype, const char *newgtconst)
gametypes[gtype].constant_name = gtconst; gametypes[gtype].constant_name = gtconst;
} }
//
// G_UpdateGametypeSelections
//
// Updates gametype_cons_t.
//
void G_UpdateGametypeSelections(void) void G_UpdateGametypeSelections(void)
{ {
INT32 i; INT32 i;

View file

@ -1999,6 +1999,7 @@ static int gametype_set(lua_State *L)
case gametype_name: case gametype_name:
Z_Free(gt->name); Z_Free(gt->name);
gt->name = Z_StrDup(luaL_checkstring(L, 3)); gt->name = Z_StrDup(luaL_checkstring(L, 3));
G_UpdateGametypeSelections();
break; break;
case gametype_rules: case gametype_rules:
gt->rules = luaL_checkinteger(L, 3); gt->rules = luaL_checkinteger(L, 3);