From 4e85f36a4787978b2e3d3e134229b169b661022c Mon Sep 17 00:00:00 2001 From: Dino Bollinger Date: Wed, 27 Apr 2022 20:18:05 +0200 Subject: [PATCH] Duke3D: Make standalone build gamefunc names available in non-standalone builds as well Fixes issues when launching Fury with synthesis eduke32 builds --- source/duke3d/src/_functio.h | 14 +------------- source/duke3d/src/function.h | 2 +- source/duke3d/src/game.cpp | 13 +++++++++++-- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/source/duke3d/src/_functio.h b/source/duke3d/src/_functio.h index 2c72ade79..17c9d733c 100644 --- a/source/duke3d/src/_functio.h +++ b/source/duke3d/src/_functio.h @@ -115,7 +115,7 @@ char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = }; // note: internal ordering is important, must not be changed -const char internal_gamefunction_names[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = +const char gamefunc_symbol_names[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = { "gamefunc_Move_Forward", "gamefunc_Move_Backward", @@ -149,17 +149,10 @@ const char internal_gamefunction_names[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = "gamefunc_Inventory", "gamefunc_Inventory_Left", "gamefunc_Inventory_Right", -#ifndef EDUKE32_STANDALONE - "gamefunc_Holo_Duke", - "gamefunc_Jetpack", - "gamefunc_NightVision", - "gamefunc_MedKit", -#else "gamefunc_Item_1", "gamefunc_Item_2", "gamefunc_Item_3", "gamefunc_Item_4", -#endif "gamefunc_TurnAround", "gamefunc_SendMessage", "gamefunc_Map", @@ -172,13 +165,8 @@ const char internal_gamefunction_names[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = "gamefunc_See_Coop_View", "gamefunc_Mouse_Aiming", "gamefunc_Toggle_Crosshair", -#ifndef EDUKE32_STANDALONE - "gamefunc_Steroids", - "gamefunc_Quick_Kick", -#else "gamefunc_Item_5", "gamefunc_Melee", -#endif "gamefunc_Next_Weapon", "gamefunc_Previous_Weapon", "gamefunc_Show_Console", diff --git a/source/duke3d/src/function.h b/source/duke3d/src/function.h index 6ccdd3c31..d552359a3 100644 --- a/source/duke3d/src/function.h +++ b/source/duke3d/src/function.h @@ -107,7 +107,7 @@ enum GameFunction_t EDUKE32_STATIC_ASSERT(NUMGAMEFUNCTIONS <= 64); // CONTROL_ButtonState and CONTROL_ButtonHeldState are uint64_t extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; -extern const char internal_gamefunction_names[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; +extern const char gamefunc_symbol_names[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; extern const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN]; extern const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN]; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 2d3d2fde3..ab3b97222 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5435,7 +5435,16 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass) for (int f = 0; f < NUMGAMEFUNCTIONS; f++) - scriptfile_addsymbolvalue(internal_gamefunction_names[f], f); + scriptfile_addsymbolvalue(gamefunc_symbol_names[f], f); + +#ifndef EDUKE32_STANDALONE + scriptfile_addsymbolvalue("gamefunc_Holo_Duke", gamefunc_Holo_Duke); + scriptfile_addsymbolvalue("gamefunc_Jetpack", gamefunc_Jetpack); + scriptfile_addsymbolvalue("gamefunc_NightVision", gamefunc_NightVision); + scriptfile_addsymbolvalue("gamefunc_MedKit", gamefunc_MedKit); + scriptfile_addsymbolvalue("gamefunc_Steroids", gamefunc_Steroids); + scriptfile_addsymbolvalue("gamefunc_Quick_Kick", gamefunc_Quick_Kick); +#endif do { @@ -5833,7 +5842,7 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass) else if (gamefunc_bitmap & (1ULL << keyIndex)) { LOG_F(WARNING, "Duplicate listing of key '%s' near line %s:%d", - internal_gamefunction_names[keyIndex], pScript->filename, scriptfile_getlinum(pScript, mapPtr)); + gamefunc_symbol_names[keyIndex], pScript->filename, scriptfile_getlinum(pScript, mapPtr)); continue; } -- GitLab