From 81a6f29dd426acdab98a58d6e52e8efc233ddd2f Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 17 Jun 2017 11:42:08 +0000 Subject: [PATCH] CON: Add undefinegamefunc. git-svn-id: https://svn.eduke32.com/eduke32@6187 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamedef.cpp | 20 ++++++++++++++++++++ source/duke3d/src/gamedef.h | 1 + 2 files changed, 21 insertions(+) diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 965d08e82..39a594fe0 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -573,6 +573,7 @@ const char *keyw[] = "ifplaybackon", // 399 "divscale", // 400 "scalevar", // 401 + "undefinegamefunc", // 402 "" }; #endif @@ -5419,6 +5420,25 @@ repeatcase: continue; + case CON_UNDEFINEGAMEFUNC: + g_scriptPtr--; + C_GetNextValue(LABEL_DEFINE); + g_scriptPtr--; + j = *g_scriptPtr; + + if (EDUKE32_PREDICT_FALSE((unsigned)j > NUMGAMEFUNCTIONS-1)) + { + initprintf("%s:%d: error: function number exceeds number of game functions.\n", + g_scriptFileName,g_lineNumber); + g_errorCnt++; + C_NextLine(); + continue; + } + + gamefunctions[j][0] = '\0'; + + continue; + case CON_DEFINESKILLNAME: g_scriptPtr--; diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index 09d513402..97c07d3cb 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -1131,6 +1131,7 @@ enum ScriptKeywords_t CON_IFPLAYBACKON, // 399 CON_DIVSCALE, // 400 CON_SCALEVAR, // 401 + CON_UNDEFINEGAMEFUNC, // 402 CON_END }; // KEEPINSYNC with the keyword list in lunatic/con_lang.lua