diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 257426f2a..743917615 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -464,6 +464,7 @@ static const char *keyw[] = "clearmapstate", // 328 "scriptsize", // 329 "definegamename", // 330 + "cmenu", // 331 "" }; @@ -3416,6 +3417,7 @@ static int parsecommand(void) if (!CheckEventSync(current_event)) ReportError(WARNING_EVENTSYNC); case CON_JUMP: + case CON_CMENU: case CON_SOUNDVAR: case CON_GLOBALSOUNDVAR: case CON_STOPSOUNDVAR: diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 1f851f030..27f458916 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -839,4 +839,5 @@ enum keywords CON_CLEARMAPSTATE, // 328 CON_SCRIPTSIZE, // 329 CON_DEFINEGAMENAME, // 330 + CON_CMENU, // 331 }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 3801044fc..5213db7db 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5719,6 +5719,12 @@ case CON_CHANGESPRITESECT: hittype[g_i].temp_data[9]=0; break; } + + case CON_CMENU: + insptr++; + j=GetGameVarID(*insptr++, g_i, g_p); + cmenu(j); + break; case CON_SOUNDVAR: case CON_STOPSOUNDVAR: diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 1e00bebb1..6637d6a7b 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -1341,6 +1341,7 @@ static void AddSystemVars() AddGameVar("lastvisinc",(intptr_t)&lastvisinc, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_SYNCCHECK); AddGameVar("numsectors",(intptr_t)&numsectors, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_SHORTPTR | GAMEVAR_FLAG_READONLY); + AddGameVar("current_menu",(intptr_t)¤t_menu, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY); AddGameVar("numplayers",(intptr_t)&numplayers, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY); AddGameVar("viewingrange",(intptr_t)&viewingrange, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK); AddGameVar("yxaspect",(intptr_t)&yxaspect, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_INTPTR | GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYNCCHECK); @@ -1488,6 +1489,7 @@ void ResetPointerVars(void) aGameVars[GetGameID("lastvisinc")].lValue = (intptr_t)&lastvisinc; aGameVars[GetGameID("numsectors")].lValue = (intptr_t)&numsectors; aGameVars[GetGameID("numplayers")].lValue = (intptr_t)&numplayers; + aGameVars[GetGameID("current_menu")].lValue = (intptr_t)¤t_menu; aGameVars[GetGameID("viewingrange")].lValue = (intptr_t)&viewingrange; aGameVars[GetGameID("yxaspect")].lValue = (intptr_t)&yxaspect; aGameVars[GetGameID("gravitationalconstant")].lValue = (intptr_t)&gc;