diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 359e9f058..a1d6eab11 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -31,8 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "osd.h" -#define NUMKEYWORDS (int32_t)ARRAY_SIZE(vm_keywords) - int32_t g_scriptVersion = 13; // 13 = 1.3D-style CON files, 14 = 1.4/1.5 style CON files char g_scriptFileName[BMAX_PATH] = "(none)"; // file we're currently compiling @@ -112,478 +110,6 @@ static char *C_GetLabelType(int32_t type) return Xstrdup(x); } - -const tokenmap_t vm_keywords[] = { - { "action", CON_ACTION }, - { "activate", CON_ACTIVATE }, - { "activatebysector", CON_ACTIVATEBYSECTOR }, - { "activatecheat", CON_ACTIVATECHEAT }, - { "actor", CON_ACTOR }, - { "addammo", CON_ADDAMMO }, - { "addinventory", CON_ADDINVENTORY }, - { "addkills", CON_ADDKILLS }, - { "addlog", CON_ADDLOG }, - { "addlogvar", CON_ADDLOGVAR }, - { "addphealth", CON_ADDPHEALTH }, - { "addstrength", CON_ADDSTRENGTH }, - { "addvar", CON_ADDVAR }, - { "addvarvar", CON_ADDVARVAR }, - { "addweapon", CON_ADDWEAPON }, - { "addweaponvar", CON_ADDWEAPONVAR }, - { "ai", CON_AI }, - { "andvar", CON_ANDVAR }, - { "andvarvar", CON_ANDVARVAR }, - { "angoff", CON_ANGOFF }, - { "angoffvar", CON_ANGOFFVAR }, - { "appendevent", CON_APPENDEVENT }, - { "betaname", CON_BETANAME }, - { "break", CON_BREAK }, - { "cactor", CON_CACTOR }, - { "calchypotenuse", CON_CALCHYPOTENUSE }, - { "cansee", CON_CANSEE }, - { "canseespr", CON_CANSEESPR }, - { "case", CON_CASE }, - { "changespritesect", CON_CHANGESPRITESECT }, - { "changespritestat", CON_CHANGESPRITESTAT }, - { "cheatkeys", CON_CHEATKEYS }, - { "checkactivatormotion", CON_CHECKACTIVATORMOTION }, - { "checkavailinven", CON_CHECKAVAILINVEN }, - { "checkavailweapon", CON_CHECKAVAILWEAPON }, - { "clamp", CON_CLAMP }, - { "clearmapstate", CON_CLEARMAPSTATE }, - { "clipdist", CON_CLIPDIST }, - { "clipmove", CON_CLIPMOVE }, - { "clipmovenoslide", CON_CLIPMOVENOSLIDE }, - { "cmenu", CON_CMENU }, - { "copy", CON_COPY }, - { "cos", CON_COS }, - { "count", CON_COUNT }, - { "cstat", CON_CSTAT }, - { "cstator", CON_CSTATOR }, - { "debris", CON_DEBRIS }, - { "debug", CON_DEBUG }, - { "default", CON_DEFAULT }, - { "define", CON_DEFINE }, - { "definecheat", CON_DEFINECHEAT }, - { "definegamefuncname", CON_DEFINEGAMEFUNCNAME }, - { "definegametype", CON_DEFINEGAMETYPE }, - { "definelevelname", CON_DEFINELEVELNAME }, - { "defineprojectile", CON_DEFINEPROJECTILE }, - { "definequote", CON_DEFINEQUOTE }, - { "defineskillname", CON_DEFINESKILLNAME }, - { "definesound", CON_DEFINESOUND }, - { "definevolumeflags", CON_DEFINEVOLUMEFLAGS }, - { "definevolumename", CON_DEFINEVOLUMENAME }, - { "defstate", CON_DEFSTATE }, - { "digitalnumber", CON_DIGITALNUMBER }, - { "digitalnumberz", CON_DIGITALNUMBERZ }, - { "displayrand", CON_DISPLAYRAND }, - { "displayrandvar", CON_DISPLAYRANDVAR }, - { "displayrandvarvar", CON_DISPLAYRANDVARVAR }, - { "dist", CON_DIST }, - { "divscale", CON_DIVSCALE }, - { "divvar", CON_DIVVAR }, - { "divvarvar", CON_DIVVARVAR }, - { "dragpoint", CON_DRAGPOINT }, - { "drawline256", CON_DRAWLINE256 }, - { "drawlinergb", CON_DRAWLINERGB }, - { "dynamicremap", CON_DYNAMICREMAP }, - { "dynamicsoundremap", CON_DYNAMICSOUNDREMAP }, - { "echo", CON_ECHO }, - { "else", CON_ELSE }, - { "enda", CON_ENDA }, - { "endevent", CON_ENDEVENT }, - { "endofgame", CON_ENDOFGAME }, - { "endoflevel", CON_ENDOFLEVEL }, - { "ends", CON_ENDS }, - { "endswitch", CON_ENDSWITCH }, - { "enhanced", CON_ENHANCED }, - { "eqspawnvar", CON_EQSPAWNVAR }, - { "eshootvar", CON_ESHOOTVAR }, - { "espawnvar", CON_ESPAWNVAR }, - { "eventloadactor", CON_EVENTLOADACTOR }, - { "ezshootvar", CON_EZSHOOTVAR }, - { "fall", CON_FALL }, - { "findnearactor3dvar", CON_FINDNEARACTOR3DVAR }, - { "findnearactorvar", CON_FINDNEARACTORVAR }, - { "findnearactorzvar", CON_FINDNEARACTORZVAR }, - { "findnearsprite3dvar", CON_FINDNEARSPRITE3DVAR }, - { "findnearspritevar", CON_FINDNEARSPRITEVAR }, - { "findnearspritezvar", CON_FINDNEARSPRITEZVAR }, - { "findotherplayer", CON_FINDOTHERPLAYER }, - { "findplayer", CON_FINDPLAYER }, - { "flash", CON_FLASH }, - { "for", CON_FOR }, - { "gamearray", CON_GAMEARRAY }, - { "gamestartup", CON_GAMESTARTUP }, - { "gametext", CON_GAMETEXT }, - { "gametextz", CON_GAMETEXTZ }, - { "gamevar", CON_GAMEVAR }, - { "getactor", CON_GETACTOR }, - { "getactorangle", CON_GETACTORANGLE }, - { "getactorvar", CON_GETACTORVAR }, - { "getangle", CON_GETANGLE }, - { "getangletotarget", CON_GETANGLETOTARGET }, - { "getarraysize", CON_GETARRAYSIZE }, - { "getceilzofslope", CON_GETCEILZOFSLOPE }, - { "getclosestcol", CON_GETCLOSESTCOL }, - { "getcurraddress", CON_GETCURRADDRESS }, - { "getflorzofslope", CON_GETFLORZOFSLOPE }, - { "getincangle", CON_GETINCANGLE }, - { "getinput", CON_GETINPUT }, - { "getkeyname", CON_GETKEYNAME }, - { "getlastpal", CON_GETLASTPAL }, - { "getmusicposition", CON_GETMUSICPOSITION }, - { "getplayer", CON_GETPLAYER }, - { "getplayerangle", CON_GETPLAYERANGLE }, - { "getplayervar", CON_GETPLAYERVAR }, - { "getpname", CON_GETPNAME }, - { "getprojectile", CON_GETPROJECTILE }, - { "getsector", CON_GETSECTOR }, - { "gettextureceiling", CON_GETTEXTURECEILING }, - { "gettexturefloor", CON_GETTEXTUREFLOOR }, - { "getthisprojectile", CON_GETTHISPROJECTILE }, - { "getticks", CON_GETTICKS }, - { "gettimedate", CON_GETTIMEDATE }, - { "gettspr", CON_GETTSPR }, - { "getuserdef", CON_GETUSERDEF }, - { "getwall", CON_GETWALL }, - { "getzrange", CON_GETZRANGE }, - { "globalsound", CON_GLOBALSOUND }, - { "globalsoundvar", CON_GLOBALSOUNDVAR }, - { "gmaxammo", CON_GMAXAMMO }, - { "guniqhudid", CON_GUNIQHUDID }, - { "guts", CON_GUTS }, - { "headspritesect", CON_HEADSPRITESECT }, - { "headspritestat", CON_HEADSPRITESTAT }, - { "hitradius", CON_HITRADIUS }, - { "hitradiusvar", CON_HITRADIUSVAR }, - { "hitscan", CON_HITSCAN }, - { "ifaction", CON_IFACTION }, - { "ifactioncount", CON_IFACTIONCOUNT }, - { "ifactor", CON_IFACTOR }, - { "ifactornotstayput", CON_IFACTORNOTSTAYPUT }, - { "ifactorsound", CON_IFACTORSOUND }, - { "ifai", CON_IFAI }, - { "ifangdiffl", CON_IFANGDIFFL }, - { "ifawayfromwall", CON_IFAWAYFROMWALL }, - { "ifbulletnear", CON_IFBULLETNEAR }, - { "ifcansee", CON_IFCANSEE }, - { "ifcanseetarget", CON_IFCANSEETARGET }, - { "ifcanshoottarget", CON_IFCANSHOOTTARGET }, - { "ifceilingdistl", CON_IFCEILINGDISTL }, - { "ifclient", CON_IFCLIENT }, - { "ifcount", CON_IFCOUNT }, - { "ifcutscene", CON_IFCUTSCENE }, - { "ifdead", CON_IFDEAD }, - { "iffloordistl", CON_IFFLOORDISTL }, - { "ifgapzl", CON_IFGAPZL }, - { "ifgotweaponce", CON_IFGOTWEAPONCE }, - { "ifhitspace", CON_IFHITSPACE }, - { "ifhitweapon", CON_IFHITWEAPON }, - { "ifinouterspace", CON_IFINOUTERSPACE }, - { "ifinspace", CON_IFINSPACE }, - { "ifinwater", CON_IFINWATER }, - { "ifmove", CON_IFMOVE }, - { "ifmultiplayer", CON_IFMULTIPLAYER }, - { "ifnosounds", CON_IFNOSOUNDS }, - { "ifnotmoving", CON_IFNOTMOVING }, - { "ifonwater", CON_IFONWATER }, - { "ifoutside", CON_IFOUTSIDE }, - { "ifp", CON_IFP }, - { "ifpdistg", CON_IFPDISTG }, - { "ifpdistl", CON_IFPDISTL }, - { "ifphealthl", CON_IFPHEALTHL }, - { "ifpinventory", CON_IFPINVENTORY }, - { "ifplaybackon", CON_IFPLAYBACKON }, - { "ifplayersl", CON_IFPLAYERSL }, - { "ifrespawn", CON_IFRESPAWN }, - { "ifrnd", CON_IFRND }, - { "ifserver", CON_IFSERVER }, - { "ifsound", CON_IFSOUND }, - { "ifspawnedby", CON_IFSPAWNEDBY }, - { "ifspritepal", CON_IFSPRITEPAL }, - { "ifsquished", CON_IFSQUISHED }, - { "ifstrength", CON_IFSTRENGTH }, - { "ifvarand", CON_IFVARAND }, - { "ifvarboth", CON_IFVARBOTH }, - { "ifvare", CON_IFVARE }, - { "ifvareither", CON_IFVAREITHER }, - { "ifvarg", CON_IFVARG }, - { "ifvarge", CON_IFVARGE }, - { "ifvarl", CON_IFVARL }, - { "ifvarle", CON_IFVARLE }, - { "ifvarn", CON_IFVARN }, - { "ifvaror", CON_IFVAROR }, - { "ifvarvarand", CON_IFVARVARAND }, - { "ifvarvarboth", CON_IFVARVARBOTH }, - { "ifvarvare", CON_IFVARVARE }, - { "ifvarvareither", CON_IFVARVAREITHER }, - { "ifvarvarg", CON_IFVARVARG }, - { "ifvarvarge", CON_IFVARVARGE }, - { "ifvarvarl", CON_IFVARVARL }, - { "ifvarvarle", CON_IFVARVARLE }, - { "ifvarvarn", CON_IFVARVARN }, - { "ifvarvaror", CON_IFVARVAROR }, - { "ifvarvarxor", CON_IFVARVARXOR }, - { "ifvarxor", CON_IFVARXOR }, - { "ifwasweapon", CON_IFWASWEAPON }, - { "include", CON_INCLUDE }, - { "includedefault", CON_INCLUDEDEFAULT }, - { "inittimer", CON_INITTIMER }, - { "insertspriteq", CON_INSERTSPRITEQ }, - { "inv", CON_INV }, - { "jump", CON_JUMP }, - { "killit", CON_KILLIT }, - { "klabs", CON_KLABS }, - { "ldist", CON_LDIST }, - { "lineintersect", CON_LINEINTERSECT }, - { "loadmapstate", CON_LOADMAPSTATE }, - { "lockplayer", CON_LOCKPLAYER }, - { "lotsofglass", CON_LOTSOFGLASS }, - { "mail", CON_MAIL }, - { "mikesnd", CON_MIKESND }, - { "minitext", CON_MINITEXT }, - { "modvar", CON_MODVAR }, - { "modvarvar", CON_MODVARVAR }, - { "money", CON_MONEY }, - { "move", CON_MOVE }, - { "movesector", CON_MOVESECTOR }, - { "movesprite", CON_MOVESPRITE }, - { "mulscale", CON_MULSCALE }, - { "mulvar", CON_MULVAR }, - { "mulvarvar", CON_MULVARVAR }, - { "music", CON_MUSIC }, - { "myos", CON_MYOS }, - { "myospal", CON_MYOSPAL }, - { "myospalx", CON_MYOSPALX }, - { "myosx", CON_MYOSX }, - { "neartag", CON_NEARTAG }, - { "nextsectorneighborz", CON_NEXTSECTORNEIGHBORZ }, - { "nextspritesect", CON_NEXTSPRITESECT }, - { "nextspritestat", CON_NEXTSPRITESTAT }, - { "nullop", CON_NULLOP }, - { "onevent", CON_ONEVENT }, - { "operate", CON_OPERATE }, - { "operateactivators", CON_OPERATEACTIVATORS }, - { "operatemasterswitches", CON_OPERATEMASTERSWITCHES }, - { "operaterespawns", CON_OPERATERESPAWNS }, - { "operatesectors", CON_OPERATESECTORS }, - { "orvar", CON_ORVAR }, - { "orvarvar", CON_ORVARVAR }, - { "palfrom", CON_PALFROM }, - { "paper", CON_PAPER }, - { "pkick", CON_PKICK }, - { "precache", CON_PRECACHE }, - { "prevspritesect", CON_PREVSPRITESECT }, - { "prevspritestat", CON_PREVSPRITESTAT }, - { "pstomp", CON_PSTOMP }, - { "qgetsysstr", CON_QGETSYSSTR }, - { "qspawnvar", CON_QSPAWNVAR }, - { "qsprintf", CON_QSPRINTF }, - { "qstrcat", CON_QSTRCAT }, - { "qstrcpy", CON_QSTRCPY }, - { "qstrdim", CON_QSTRDIM }, - { "qstrlen", CON_QSTRLEN }, - { "qstrncat", CON_QSTRNCAT }, - { "qsubstr", CON_QSUBSTR }, - { "quake", CON_QUAKE }, - { "quote", CON_QUOTE }, - { "randvar", CON_RANDVAR }, - { "randvarvar", CON_RANDVARVAR }, - { "rayintersect", CON_RAYINTERSECT }, - { "readarrayfromfile", CON_READARRAYFROMFILE }, - { "readgamevar", CON_READGAMEVAR }, - { "redefinequote", CON_REDEFINEQUOTE }, - { "resetactioncount", CON_RESETACTIONCOUNT }, - { "resetcount", CON_RESETCOUNT }, - { "resetplayer", CON_RESETPLAYER }, - { "resetplayerflags", CON_RESETPLAYERFLAGS }, - { "resizearray", CON_RESIZEARRAY }, - { "respawnhitag", CON_RESPAWNHITAG }, - { "return", CON_RETURN }, - { "rotatepoint", CON_ROTATEPOINT }, - { "rotatesprite", CON_ROTATESPRITE }, - { "rotatesprite16", CON_ROTATESPRITE16 }, - { "rotatespritea", CON_ROTATESPRITEA }, - { "save", CON_SAVE }, - { "savegamevar", CON_SAVEGAMEVAR }, - { "savemapstate", CON_SAVEMAPSTATE }, - { "savenn", CON_SAVENN }, - { "scalevar", CON_SCALEVAR }, - { "screensound", CON_SCREENSOUND }, - { "screentext", CON_SCREENTEXT }, - { "scriptsize", CON_SCRIPTSIZE }, - { "sectclearinterpolation", CON_SECTCLEARINTERPOLATION }, - { "sectgethitag", CON_SECTGETHITAG }, - { "sectgetlotag", CON_SECTGETLOTAG }, - { "sectorofwall", CON_SECTOROFWALL }, - { "sectsetinterpolation", CON_SECTSETINTERPOLATION }, - { "setactor", CON_SETACTOR }, - { "setactorangle", CON_SETACTORANGLE }, - { "setactorsoundpitch", CON_SETACTORSOUNDPITCH }, - { "setactorvar", CON_SETACTORVAR }, - { "setarray", CON_SETARRAY }, - { "setaspect", CON_SETASPECT }, - { "setcfgname", CON_SETCFGNAME }, - { "setdefname", CON_SETDEFNAME }, - { "setgamename", CON_SETGAMENAME }, - { "setgamepalette", CON_SETGAMEPALETTE }, - { "setinput", CON_SETINPUT }, - { "setmusicposition", CON_SETMUSICPOSITION }, - { "setplayer", CON_SETPLAYER }, - { "setplayerangle", CON_SETPLAYERANGLE }, - { "setplayervar", CON_SETPLAYERVAR }, - { "setprojectile", CON_SETPROJECTILE }, - { "setsector", CON_SETSECTOR }, - { "setsprite", CON_SETSPRITE }, - { "setthisprojectile", CON_SETTHISPROJECTILE }, - { "settspr", CON_SETTSPR }, - { "setuserdef", CON_SETUSERDEF }, - { "setvar", CON_SETVAR }, - { "setvarvar", CON_SETVARVAR }, - { "setwall", CON_SETWALL }, - { "shadeto", CON_SHADETO }, - { "shiftvarl", CON_SHIFTVARL }, - { "shiftvarr", CON_SHIFTVARR }, - { "shiftvarvarl", CON_SHIFTVARVARL }, - { "shiftvarvarr", CON_SHIFTVARVARR }, - { "shootvar", CON_SHOOTVAR }, - { "showview", CON_SHOWVIEW }, - { "showviewunbiased", CON_SHOWVIEWUNBIASED }, - { "sin", CON_SIN }, - { "sizeat", CON_SIZEAT }, - { "sizeto", CON_SIZETO }, - { "sleeptime", CON_SLEEPTIME }, - { "smaxammo", CON_SMAXAMMO }, - { "sound", CON_SOUND }, - { "soundonce", CON_SOUNDONCE }, - { "soundoncevar", CON_SOUNDONCEVAR }, - { "soundvar", CON_SOUNDVAR }, - { "spawn", CON_SPAWN }, - { "spgethitag", CON_SPGETHITAG }, - { "spgetlotag", CON_SPGETLOTAG }, - { "spriteflags", CON_SPRITEFLAGS }, - { "spritenopal", CON_SPRITENOPAL }, - { "spritenoshade", CON_SPRITENOSHADE }, - { "spritenvg", CON_SPRITENVG }, - { "spritepal", CON_SPRITEPAL }, - { "spriteshadow", CON_SPRITESHADOW }, - { "sqrt", CON_SQRT }, - { "ssp", CON_SSP }, - { "startcutscene", CON_STARTCUTSCENE }, - { "startlevel", CON_STARTLEVEL }, - { "starttrack", CON_STARTTRACK }, - { "starttrackslot", CON_STARTTRACKSLOT }, - { "starttrackvar", CON_STARTTRACKVAR }, - { "state", CON_STATE }, - { "stopactorsound", CON_STOPACTORSOUND }, - { "stopallmusic", CON_STOPALLMUSIC }, - { "stopallsounds", CON_STOPALLSOUNDS }, - { "stopsound", CON_STOPSOUND }, - { "stopsoundvar", CON_STOPSOUNDVAR }, - { "strength", CON_STRENGTH }, - { "subvar", CON_SUBVAR }, - { "subvarvar", CON_SUBVARVAR }, - { "switch", CON_SWITCH }, - { "time", CON_TIME }, - { "tip", CON_TIP }, - { "tossweapon", CON_TOSSWEAPON }, - { "undefinegamefunc", CON_UNDEFINEGAMEFUNC }, - { "undefinelevel", CON_UNDEFINELEVEL }, - { "undefineskill", CON_UNDEFINESKILL }, - { "undefinevolume", CON_UNDEFINEVOLUME }, - { "updatesector", CON_UPDATESECTOR }, - { "updatesectorz", CON_UPDATESECTORZ }, - { "useractor", CON_USERACTOR }, - { "userquote", CON_USERQUOTE }, - { "wackplayer", CON_WACKPLAYER }, - { "whilevarl", CON_WHILEVARL }, - { "whilevarn", CON_WHILEVARN }, - { "whilevarvarl", CON_WHILEVARVARL }, - { "whilevarvarn", CON_WHILEVARVARN }, - { "writearraytofile", CON_WRITEARRAYTOFILE }, - { "xorvar", CON_XORVAR }, - { "xorvarvar", CON_XORVARVAR }, - { "zshootvar", CON_ZSHOOTVAR }, - { "{", CON_LEFTBRACE }, - { "}", CON_RIGHTBRACE }, - - { "#define", CON_DEFINE }, - { "#include", CON_INCLUDE }, - { "al", CON_ADDLOGVAR }, - { "var", CON_GAMEVAR }, - { "array", CON_GAMEARRAY }, - { "shiftl", CON_SHIFTVARVARL }, - { "shiftr", CON_SHIFTVARVARR }, - { "rand", CON_RANDVARVAR }, - { "set", CON_SETVARVAR }, - { "add", CON_ADDVARVAR }, - { "sub", CON_SUBVARVAR }, - { "mul", CON_MULVARVAR }, - { "div", CON_DIVVARVAR }, - { "mod", CON_MODVARVAR }, - { "and", CON_ANDVARVAR }, - { "or", CON_ORVARVAR }, - { "xor", CON_XORVARVAR }, - { "ifl", CON_IFVARVARL }, - { "ifle", CON_IFVARVARLE }, - { "ifg", CON_IFVARVARG }, - { "ifge", CON_IFVARVARGE }, - { "ife", CON_IFVARVARE }, - { "ifn", CON_IFVARVARN }, - { "ifand", CON_IFVARVARAND }, - { "ifor", CON_IFVARVAROR }, - { "ifxor", CON_IFVARVARXOR }, - { "ifeither", CON_IFVARVAREITHER }, - { "ifboth", CON_IFVARVARBOTH }, - { "whilen", CON_WHILEVARVARN }, - { "whilel", CON_WHILEVARVARL }, - { "abs", CON_KLABS }, - - { "getp", CON_GETPLAYER }, - { "getpv", CON_GETPLAYERVAR }, - { "gets", CON_GETSECTOR }, - { "geta", CON_GETACTOR }, - { "getav", CON_GETACTORVAR }, - { "getw", CON_GETWALL }, - { "getu", CON_GETUSERDEF }, - { "geti", CON_GETINPUT }, - - { "setp", CON_SETPLAYER }, - { "setpv", CON_SETPLAYERVAR }, - { "sets", CON_SETSECTOR }, - { "seta", CON_SETACTOR }, - { "setav", CON_SETACTORVAR }, - { "setw", CON_SETWALL }, - { "setu", CON_SETUSERDEF }, - { "seti", CON_SETINPUT }, - - { "string", CON_DEFINEQUOTE }, - { "print", CON_QUOTE }, - - { "dc", CON_DEFINECHEAT }, - { "ck", CON_CHEATKEYS }, - - { "qputs", CON_REDEFINEQUOTE }, - - { "espawn", CON_ESPAWNVAR }, - { "qspawn", CON_QSPAWNVAR }, - { "eqspawn", CON_EQSPAWNVAR }, - - { "eshoot", CON_ESHOOTVAR }, - { "zshoot", CON_ZSHOOTVAR }, - { "ezshoot", CON_EZSHOOTVAR }, - { "shoot", CON_SHOOTVAR }, - - { "findnearactor", CON_FINDNEARACTORVAR }, - { "findnearactor3d", CON_FINDNEARACTOR3DVAR }, - { "findnearactorz", CON_FINDNEARACTORZVAR }, - - { "findnearsprite", CON_FINDNEARSPRITEVAR }, - { "findnearsprite3d", CON_FINDNEARSPRITE3DVAR }, - { "findnearspritez", CON_FINDNEARSPRITEZVAR }, -}; #endif // KEEPINSYNC with enum GameEvent_t and lunatic/con_lang.lua @@ -749,7 +275,7 @@ const memberlabel_t SectorLabels[]= { "floorbunch", SECTOR_FLOORBUNCH, 0, 0 }, { "ulotag", SECTOR_ULOTAG, 0, 0 }, { "uhitag", SECTOR_UHITAG, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t WallLabels[]= @@ -774,7 +300,7 @@ const memberlabel_t WallLabels[]= { "ulotag", WALL_ULOTAG, 0, 0 }, { "uhitag", WALL_UHITAG, 0, 0 }, { "blend", WALL_BLEND, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t ActorLabels[]= @@ -848,7 +374,7 @@ const memberlabel_t ActorLabels[]= { "movflags", ACTOR_HITAG, 0, 0 }, { "detail", ACTOR_DETAIL, 0, 0 }, // deprecated name for 'blend' - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t TsprLabels[]= @@ -884,7 +410,7 @@ const memberlabel_t TsprLabels[]= // aliases: { "tsprdetail", ACTOR_DETAIL, 0, 0 }, // deprecated name for 'tsprblend' - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t PlayerLabels[]= @@ -1041,7 +567,7 @@ const memberlabel_t PlayerLabels[]= { "hudpal", PLAYER_HUDPAL, 0, 0 }, { "index", PLAYER_INDEX, 0, 0 }, { "connected", PLAYER_CONNECTED, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t ProjectileLabels[]= @@ -1076,7 +602,7 @@ const memberlabel_t ProjectileLabels[]= { "range", PROJ_RANGE, 0, 0 }, { "flashcolor", PROJ_FLASH_COLOR, 0, 0 }, { "userdata", PROJ_USERDATA, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t UserdefsLabels[]= @@ -1201,7 +727,7 @@ const memberlabel_t UserdefsLabels[]= { "mgametext_tracking", USERDEFS_MGAMETEXT_TRACKING, 0, 0 }, { "menutext_tracking", USERDEFS_MENUTEXT_TRACKING, 0, 0 }, { "maxspritesonscreen", USERDEFS_MAXSPRITESONSCREEN, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t InputLabels[]= @@ -1212,7 +738,7 @@ const memberlabel_t InputLabels[]= { "svel", INPUT_SVEL, 0, 0 }, { "bits", INPUT_BITS, 0, 0 }, { "extbits", INPUT_EXTBITS, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t TileDataLabels[]= @@ -1231,7 +757,7 @@ const memberlabel_t TileDataLabels[]= // g_tile[] { "gameflags", TILEDATA_GAMEFLAGS, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const memberlabel_t PalDataLabels[]= @@ -1239,7 +765,7 @@ const memberlabel_t PalDataLabels[]= // g_noFloorPal[] { "nofloorpal", PALDATA_NOFLOORPAL, 0, 0 }, - { "", -1, 0, 0 } // END OF LIST + { NULL, -1, 0, 0 } // END OF LIST }; const tokenmap_t iter_tokens [] = @@ -1259,7 +785,7 @@ const tokenmap_t iter_tokens [] = { "sprofsec", ITER_SPRITESOFSECTOR }, { "sprofstat", ITER_SPRITESOFSTATUS }, { "walofsec", ITER_WALLSOFSECTOR }, - { "", -1 } // END OF LIST + { NULL, -1 } // END OF LIST }; #endif diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index f466968c9..bc2f2a195 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -202,7 +202,6 @@ typedef struct { int32_t val; } tokenmap_t; -extern const tokenmap_t vm_keywords[]; extern const tokenmap_t iter_tokens[]; // KEEPINSYNC lunatic/con_lang.lua @@ -1147,6 +1146,481 @@ enum ScriptKeywords_t CON_END }; // KEEPINSYNC with the keyword list in lunatic/con_lang.lua + +static const tokenmap_t vm_keywords [] ={ + { "action", CON_ACTION }, + { "activate", CON_ACTIVATE }, + { "activatebysector", CON_ACTIVATEBYSECTOR }, + { "activatecheat", CON_ACTIVATECHEAT }, + { "actor", CON_ACTOR }, + { "addammo", CON_ADDAMMO }, + { "addinventory", CON_ADDINVENTORY }, + { "addkills", CON_ADDKILLS }, + { "addlog", CON_ADDLOG }, + { "addlogvar", CON_ADDLOGVAR }, + { "addphealth", CON_ADDPHEALTH }, + { "addstrength", CON_ADDSTRENGTH }, + { "addvar", CON_ADDVAR }, + { "addvarvar", CON_ADDVARVAR }, + { "addweapon", CON_ADDWEAPON }, + { "addweaponvar", CON_ADDWEAPONVAR }, + { "ai", CON_AI }, + { "andvar", CON_ANDVAR }, + { "andvarvar", CON_ANDVARVAR }, + { "angoff", CON_ANGOFF }, + { "angoffvar", CON_ANGOFFVAR }, + { "appendevent", CON_APPENDEVENT }, + { "betaname", CON_BETANAME }, + { "break", CON_BREAK }, + { "cactor", CON_CACTOR }, + { "calchypotenuse", CON_CALCHYPOTENUSE }, + { "cansee", CON_CANSEE }, + { "canseespr", CON_CANSEESPR }, + { "case", CON_CASE }, + { "changespritesect", CON_CHANGESPRITESECT }, + { "changespritestat", CON_CHANGESPRITESTAT }, + { "cheatkeys", CON_CHEATKEYS }, + { "checkactivatormotion", CON_CHECKACTIVATORMOTION }, + { "checkavailinven", CON_CHECKAVAILINVEN }, + { "checkavailweapon", CON_CHECKAVAILWEAPON }, + { "clamp", CON_CLAMP }, + { "clearmapstate", CON_CLEARMAPSTATE }, + { "clipdist", CON_CLIPDIST }, + { "clipmove", CON_CLIPMOVE }, + { "clipmovenoslide", CON_CLIPMOVENOSLIDE }, + { "cmenu", CON_CMENU }, + { "copy", CON_COPY }, + { "cos", CON_COS }, + { "count", CON_COUNT }, + { "cstat", CON_CSTAT }, + { "cstator", CON_CSTATOR }, + { "debris", CON_DEBRIS }, + { "debug", CON_DEBUG }, + { "default", CON_DEFAULT }, + { "define", CON_DEFINE }, + { "definecheat", CON_DEFINECHEAT }, + { "definegamefuncname", CON_DEFINEGAMEFUNCNAME }, + { "definegametype", CON_DEFINEGAMETYPE }, + { "definelevelname", CON_DEFINELEVELNAME }, + { "defineprojectile", CON_DEFINEPROJECTILE }, + { "definequote", CON_DEFINEQUOTE }, + { "defineskillname", CON_DEFINESKILLNAME }, + { "definesound", CON_DEFINESOUND }, + { "definevolumeflags", CON_DEFINEVOLUMEFLAGS }, + { "definevolumename", CON_DEFINEVOLUMENAME }, + { "defstate", CON_DEFSTATE }, + { "digitalnumber", CON_DIGITALNUMBER }, + { "digitalnumberz", CON_DIGITALNUMBERZ }, + { "displayrand", CON_DISPLAYRAND }, + { "displayrandvar", CON_DISPLAYRANDVAR }, + { "displayrandvarvar", CON_DISPLAYRANDVARVAR }, + { "dist", CON_DIST }, + { "divscale", CON_DIVSCALE }, + { "divvar", CON_DIVVAR }, + { "divvarvar", CON_DIVVARVAR }, + { "dragpoint", CON_DRAGPOINT }, + { "drawline256", CON_DRAWLINE256 }, + { "drawlinergb", CON_DRAWLINERGB }, + { "dynamicremap", CON_DYNAMICREMAP }, + { "dynamicsoundremap", CON_DYNAMICSOUNDREMAP }, + { "echo", CON_ECHO }, + { "else", CON_ELSE }, + { "enda", CON_ENDA }, + { "endevent", CON_ENDEVENT }, + { "endofgame", CON_ENDOFGAME }, + { "endoflevel", CON_ENDOFLEVEL }, + { "ends", CON_ENDS }, + { "endswitch", CON_ENDSWITCH }, + { "enhanced", CON_ENHANCED }, + { "eqspawnvar", CON_EQSPAWNVAR }, + { "eshootvar", CON_ESHOOTVAR }, + { "espawnvar", CON_ESPAWNVAR }, + { "eventloadactor", CON_EVENTLOADACTOR }, + { "ezshootvar", CON_EZSHOOTVAR }, + { "fall", CON_FALL }, + { "findnearactor3dvar", CON_FINDNEARACTOR3DVAR }, + { "findnearactorvar", CON_FINDNEARACTORVAR }, + { "findnearactorzvar", CON_FINDNEARACTORZVAR }, + { "findnearsprite3dvar", CON_FINDNEARSPRITE3DVAR }, + { "findnearspritevar", CON_FINDNEARSPRITEVAR }, + { "findnearspritezvar", CON_FINDNEARSPRITEZVAR }, + { "findotherplayer", CON_FINDOTHERPLAYER }, + { "findplayer", CON_FINDPLAYER }, + { "flash", CON_FLASH }, + { "for", CON_FOR }, + { "gamearray", CON_GAMEARRAY }, + { "gamestartup", CON_GAMESTARTUP }, + { "gametext", CON_GAMETEXT }, + { "gametextz", CON_GAMETEXTZ }, + { "gamevar", CON_GAMEVAR }, + { "getactor", CON_GETACTOR }, + { "getactorangle", CON_GETACTORANGLE }, + { "getactorvar", CON_GETACTORVAR }, + { "getangle", CON_GETANGLE }, + { "getangletotarget", CON_GETANGLETOTARGET }, + { "getarraysize", CON_GETARRAYSIZE }, + { "getceilzofslope", CON_GETCEILZOFSLOPE }, + { "getclosestcol", CON_GETCLOSESTCOL }, + { "getcurraddress", CON_GETCURRADDRESS }, + { "getflorzofslope", CON_GETFLORZOFSLOPE }, + { "getincangle", CON_GETINCANGLE }, + { "getinput", CON_GETINPUT }, + { "getkeyname", CON_GETKEYNAME }, + { "getlastpal", CON_GETLASTPAL }, + { "getmusicposition", CON_GETMUSICPOSITION }, + { "getplayer", CON_GETPLAYER }, + { "getplayerangle", CON_GETPLAYERANGLE }, + { "getplayervar", CON_GETPLAYERVAR }, + { "getpname", CON_GETPNAME }, + { "getprojectile", CON_GETPROJECTILE }, + { "getsector", CON_GETSECTOR }, + { "gettextureceiling", CON_GETTEXTURECEILING }, + { "gettexturefloor", CON_GETTEXTUREFLOOR }, + { "getthisprojectile", CON_GETTHISPROJECTILE }, + { "getticks", CON_GETTICKS }, + { "gettimedate", CON_GETTIMEDATE }, + { "gettspr", CON_GETTSPR }, + { "getuserdef", CON_GETUSERDEF }, + { "getwall", CON_GETWALL }, + { "getzrange", CON_GETZRANGE }, + { "globalsound", CON_GLOBALSOUND }, + { "globalsoundvar", CON_GLOBALSOUNDVAR }, + { "gmaxammo", CON_GMAXAMMO }, + { "guniqhudid", CON_GUNIQHUDID }, + { "guts", CON_GUTS }, + { "headspritesect", CON_HEADSPRITESECT }, + { "headspritestat", CON_HEADSPRITESTAT }, + { "hitradius", CON_HITRADIUS }, + { "hitradiusvar", CON_HITRADIUSVAR }, + { "hitscan", CON_HITSCAN }, + { "ifaction", CON_IFACTION }, + { "ifactioncount", CON_IFACTIONCOUNT }, + { "ifactor", CON_IFACTOR }, + { "ifactornotstayput", CON_IFACTORNOTSTAYPUT }, + { "ifactorsound", CON_IFACTORSOUND }, + { "ifai", CON_IFAI }, + { "ifangdiffl", CON_IFANGDIFFL }, + { "ifawayfromwall", CON_IFAWAYFROMWALL }, + { "ifbulletnear", CON_IFBULLETNEAR }, + { "ifcansee", CON_IFCANSEE }, + { "ifcanseetarget", CON_IFCANSEETARGET }, + { "ifcanshoottarget", CON_IFCANSHOOTTARGET }, + { "ifceilingdistl", CON_IFCEILINGDISTL }, + { "ifclient", CON_IFCLIENT }, + { "ifcount", CON_IFCOUNT }, + { "ifcutscene", CON_IFCUTSCENE }, + { "ifdead", CON_IFDEAD }, + { "iffloordistl", CON_IFFLOORDISTL }, + { "ifgapzl", CON_IFGAPZL }, + { "ifgotweaponce", CON_IFGOTWEAPONCE }, + { "ifhitspace", CON_IFHITSPACE }, + { "ifhitweapon", CON_IFHITWEAPON }, + { "ifinouterspace", CON_IFINOUTERSPACE }, + { "ifinspace", CON_IFINSPACE }, + { "ifinwater", CON_IFINWATER }, + { "ifmove", CON_IFMOVE }, + { "ifmultiplayer", CON_IFMULTIPLAYER }, + { "ifnosounds", CON_IFNOSOUNDS }, + { "ifnotmoving", CON_IFNOTMOVING }, + { "ifonwater", CON_IFONWATER }, + { "ifoutside", CON_IFOUTSIDE }, + { "ifp", CON_IFP }, + { "ifpdistg", CON_IFPDISTG }, + { "ifpdistl", CON_IFPDISTL }, + { "ifphealthl", CON_IFPHEALTHL }, + { "ifpinventory", CON_IFPINVENTORY }, + { "ifplaybackon", CON_IFPLAYBACKON }, + { "ifplayersl", CON_IFPLAYERSL }, + { "ifrespawn", CON_IFRESPAWN }, + { "ifrnd", CON_IFRND }, + { "ifserver", CON_IFSERVER }, + { "ifsound", CON_IFSOUND }, + { "ifspawnedby", CON_IFSPAWNEDBY }, + { "ifspritepal", CON_IFSPRITEPAL }, + { "ifsquished", CON_IFSQUISHED }, + { "ifstrength", CON_IFSTRENGTH }, + { "ifvarand", CON_IFVARAND }, + { "ifvarboth", CON_IFVARBOTH }, + { "ifvare", CON_IFVARE }, + { "ifvareither", CON_IFVAREITHER }, + { "ifvarg", CON_IFVARG }, + { "ifvarge", CON_IFVARGE }, + { "ifvarl", CON_IFVARL }, + { "ifvarle", CON_IFVARLE }, + { "ifvarn", CON_IFVARN }, + { "ifvaror", CON_IFVAROR }, + { "ifvarvarand", CON_IFVARVARAND }, + { "ifvarvarboth", CON_IFVARVARBOTH }, + { "ifvarvare", CON_IFVARVARE }, + { "ifvarvareither", CON_IFVARVAREITHER }, + { "ifvarvarg", CON_IFVARVARG }, + { "ifvarvarge", CON_IFVARVARGE }, + { "ifvarvarl", CON_IFVARVARL }, + { "ifvarvarle", CON_IFVARVARLE }, + { "ifvarvarn", CON_IFVARVARN }, + { "ifvarvaror", CON_IFVARVAROR }, + { "ifvarvarxor", CON_IFVARVARXOR }, + { "ifvarxor", CON_IFVARXOR }, + { "ifwasweapon", CON_IFWASWEAPON }, + { "include", CON_INCLUDE }, + { "includedefault", CON_INCLUDEDEFAULT }, + { "inittimer", CON_INITTIMER }, + { "insertspriteq", CON_INSERTSPRITEQ }, + { "inv", CON_INV }, + { "jump", CON_JUMP }, + { "killit", CON_KILLIT }, + { "klabs", CON_KLABS }, + { "ldist", CON_LDIST }, + { "lineintersect", CON_LINEINTERSECT }, + { "loadmapstate", CON_LOADMAPSTATE }, + { "lockplayer", CON_LOCKPLAYER }, + { "lotsofglass", CON_LOTSOFGLASS }, + { "mail", CON_MAIL }, + { "mikesnd", CON_MIKESND }, + { "minitext", CON_MINITEXT }, + { "modvar", CON_MODVAR }, + { "modvarvar", CON_MODVARVAR }, + { "money", CON_MONEY }, + { "move", CON_MOVE }, + { "movesector", CON_MOVESECTOR }, + { "movesprite", CON_MOVESPRITE }, + { "mulscale", CON_MULSCALE }, + { "mulvar", CON_MULVAR }, + { "mulvarvar", CON_MULVARVAR }, + { "music", CON_MUSIC }, + { "myos", CON_MYOS }, + { "myospal", CON_MYOSPAL }, + { "myospalx", CON_MYOSPALX }, + { "myosx", CON_MYOSX }, + { "neartag", CON_NEARTAG }, + { "nextsectorneighborz", CON_NEXTSECTORNEIGHBORZ }, + { "nextspritesect", CON_NEXTSPRITESECT }, + { "nextspritestat", CON_NEXTSPRITESTAT }, + { "nullop", CON_NULLOP }, + { "onevent", CON_ONEVENT }, + { "operate", CON_OPERATE }, + { "operateactivators", CON_OPERATEACTIVATORS }, + { "operatemasterswitches", CON_OPERATEMASTERSWITCHES }, + { "operaterespawns", CON_OPERATERESPAWNS }, + { "operatesectors", CON_OPERATESECTORS }, + { "orvar", CON_ORVAR }, + { "orvarvar", CON_ORVARVAR }, + { "palfrom", CON_PALFROM }, + { "paper", CON_PAPER }, + { "pkick", CON_PKICK }, + { "precache", CON_PRECACHE }, + { "prevspritesect", CON_PREVSPRITESECT }, + { "prevspritestat", CON_PREVSPRITESTAT }, + { "pstomp", CON_PSTOMP }, + { "qgetsysstr", CON_QGETSYSSTR }, + { "qspawnvar", CON_QSPAWNVAR }, + { "qsprintf", CON_QSPRINTF }, + { "qstrcat", CON_QSTRCAT }, + { "qstrcpy", CON_QSTRCPY }, + { "qstrdim", CON_QSTRDIM }, + { "qstrlen", CON_QSTRLEN }, + { "qstrncat", CON_QSTRNCAT }, + { "qsubstr", CON_QSUBSTR }, + { "quake", CON_QUAKE }, + { "quote", CON_QUOTE }, + { "randvar", CON_RANDVAR }, + { "randvarvar", CON_RANDVARVAR }, + { "rayintersect", CON_RAYINTERSECT }, + { "readarrayfromfile", CON_READARRAYFROMFILE }, + { "readgamevar", CON_READGAMEVAR }, + { "redefinequote", CON_REDEFINEQUOTE }, + { "resetactioncount", CON_RESETACTIONCOUNT }, + { "resetcount", CON_RESETCOUNT }, + { "resetplayer", CON_RESETPLAYER }, + { "resetplayerflags", CON_RESETPLAYERFLAGS }, + { "resizearray", CON_RESIZEARRAY }, + { "respawnhitag", CON_RESPAWNHITAG }, + { "return", CON_RETURN }, + { "rotatepoint", CON_ROTATEPOINT }, + { "rotatesprite", CON_ROTATESPRITE }, + { "rotatesprite16", CON_ROTATESPRITE16 }, + { "rotatespritea", CON_ROTATESPRITEA }, + { "save", CON_SAVE }, + { "savegamevar", CON_SAVEGAMEVAR }, + { "savemapstate", CON_SAVEMAPSTATE }, + { "savenn", CON_SAVENN }, + { "scalevar", CON_SCALEVAR }, + { "screensound", CON_SCREENSOUND }, + { "screentext", CON_SCREENTEXT }, + { "scriptsize", CON_SCRIPTSIZE }, + { "sectclearinterpolation", CON_SECTCLEARINTERPOLATION }, + { "sectgethitag", CON_SECTGETHITAG }, + { "sectgetlotag", CON_SECTGETLOTAG }, + { "sectorofwall", CON_SECTOROFWALL }, + { "sectsetinterpolation", CON_SECTSETINTERPOLATION }, + { "setactor", CON_SETACTOR }, + { "setactorangle", CON_SETACTORANGLE }, + { "setactorsoundpitch", CON_SETACTORSOUNDPITCH }, + { "setactorvar", CON_SETACTORVAR }, + { "setarray", CON_SETARRAY }, + { "setaspect", CON_SETASPECT }, + { "setcfgname", CON_SETCFGNAME }, + { "setdefname", CON_SETDEFNAME }, + { "setgamename", CON_SETGAMENAME }, + { "setgamepalette", CON_SETGAMEPALETTE }, + { "setinput", CON_SETINPUT }, + { "setmusicposition", CON_SETMUSICPOSITION }, + { "setplayer", CON_SETPLAYER }, + { "setplayerangle", CON_SETPLAYERANGLE }, + { "setplayervar", CON_SETPLAYERVAR }, + { "setprojectile", CON_SETPROJECTILE }, + { "setsector", CON_SETSECTOR }, + { "setsprite", CON_SETSPRITE }, + { "setthisprojectile", CON_SETTHISPROJECTILE }, + { "settspr", CON_SETTSPR }, + { "setuserdef", CON_SETUSERDEF }, + { "setvar", CON_SETVAR }, + { "setvarvar", CON_SETVARVAR }, + { "setwall", CON_SETWALL }, + { "shadeto", CON_SHADETO }, + { "shiftvarl", CON_SHIFTVARL }, + { "shiftvarr", CON_SHIFTVARR }, + { "shiftvarvarl", CON_SHIFTVARVARL }, + { "shiftvarvarr", CON_SHIFTVARVARR }, + { "shootvar", CON_SHOOTVAR }, + { "showview", CON_SHOWVIEW }, + { "showviewunbiased", CON_SHOWVIEWUNBIASED }, + { "sin", CON_SIN }, + { "sizeat", CON_SIZEAT }, + { "sizeto", CON_SIZETO }, + { "sleeptime", CON_SLEEPTIME }, + { "smaxammo", CON_SMAXAMMO }, + { "sound", CON_SOUND }, + { "soundonce", CON_SOUNDONCE }, + { "soundoncevar", CON_SOUNDONCEVAR }, + { "soundvar", CON_SOUNDVAR }, + { "spawn", CON_SPAWN }, + { "spgethitag", CON_SPGETHITAG }, + { "spgetlotag", CON_SPGETLOTAG }, + { "spriteflags", CON_SPRITEFLAGS }, + { "spritenopal", CON_SPRITENOPAL }, + { "spritenoshade", CON_SPRITENOSHADE }, + { "spritenvg", CON_SPRITENVG }, + { "spritepal", CON_SPRITEPAL }, + { "spriteshadow", CON_SPRITESHADOW }, + { "sqrt", CON_SQRT }, + { "ssp", CON_SSP }, + { "startcutscene", CON_STARTCUTSCENE }, + { "startlevel", CON_STARTLEVEL }, + { "starttrack", CON_STARTTRACK }, + { "starttrackslot", CON_STARTTRACKSLOT }, + { "starttrackvar", CON_STARTTRACKVAR }, + { "state", CON_STATE }, + { "stopactorsound", CON_STOPACTORSOUND }, + { "stopallmusic", CON_STOPALLMUSIC }, + { "stopallsounds", CON_STOPALLSOUNDS }, + { "stopsound", CON_STOPSOUND }, + { "stopsoundvar", CON_STOPSOUNDVAR }, + { "strength", CON_STRENGTH }, + { "subvar", CON_SUBVAR }, + { "subvarvar", CON_SUBVARVAR }, + { "switch", CON_SWITCH }, + { "time", CON_TIME }, + { "tip", CON_TIP }, + { "tossweapon", CON_TOSSWEAPON }, + { "undefinegamefunc", CON_UNDEFINEGAMEFUNC }, + { "undefinelevel", CON_UNDEFINELEVEL }, + { "undefineskill", CON_UNDEFINESKILL }, + { "undefinevolume", CON_UNDEFINEVOLUME }, + { "updatesector", CON_UPDATESECTOR }, + { "updatesectorz", CON_UPDATESECTORZ }, + { "useractor", CON_USERACTOR }, + { "userquote", CON_USERQUOTE }, + { "wackplayer", CON_WACKPLAYER }, + { "whilevarl", CON_WHILEVARL }, + { "whilevarn", CON_WHILEVARN }, + { "whilevarvarl", CON_WHILEVARVARL }, + { "whilevarvarn", CON_WHILEVARVARN }, + { "writearraytofile", CON_WRITEARRAYTOFILE }, + { "xorvar", CON_XORVAR }, + { "xorvarvar", CON_XORVARVAR }, + { "zshootvar", CON_ZSHOOTVAR }, + { "{", CON_LEFTBRACE }, + { "}", CON_RIGHTBRACE }, + + { "#define", CON_DEFINE }, + { "#include", CON_INCLUDE }, + { "al", CON_ADDLOGVAR }, + { "var", CON_GAMEVAR }, + { "array", CON_GAMEARRAY }, + { "shiftl", CON_SHIFTVARVARL }, + { "shiftr", CON_SHIFTVARVARR }, + { "rand", CON_RANDVARVAR }, + { "set", CON_SETVARVAR }, + { "add", CON_ADDVARVAR }, + { "sub", CON_SUBVARVAR }, + { "mul", CON_MULVARVAR }, + { "div", CON_DIVVARVAR }, + { "mod", CON_MODVARVAR }, + { "and", CON_ANDVARVAR }, + { "or", CON_ORVARVAR }, + { "xor", CON_XORVARVAR }, + { "ifl", CON_IFVARVARL }, + { "ifle", CON_IFVARVARLE }, + { "ifg", CON_IFVARVARG }, + { "ifge", CON_IFVARVARGE }, + { "ife", CON_IFVARVARE }, + { "ifn", CON_IFVARVARN }, + { "ifand", CON_IFVARVARAND }, + { "ifor", CON_IFVARVAROR }, + { "ifxor", CON_IFVARVARXOR }, + { "ifeither", CON_IFVARVAREITHER }, + { "ifboth", CON_IFVARVARBOTH }, + { "whilen", CON_WHILEVARVARN }, + { "whilel", CON_WHILEVARVARL }, + { "abs", CON_KLABS }, + + { "getp", CON_GETPLAYER }, + { "getpv", CON_GETPLAYERVAR }, + { "gets", CON_GETSECTOR }, + { "geta", CON_GETACTOR }, + { "getav", CON_GETACTORVAR }, + { "getw", CON_GETWALL }, + { "getu", CON_GETUSERDEF }, + { "geti", CON_GETINPUT }, + + { "setp", CON_SETPLAYER }, + { "setpv", CON_SETPLAYERVAR }, + { "sets", CON_SETSECTOR }, + { "seta", CON_SETACTOR }, + { "setav", CON_SETACTORVAR }, + { "setw", CON_SETWALL }, + { "setu", CON_SETUSERDEF }, + { "seti", CON_SETINPUT }, + + { "string", CON_DEFINEQUOTE }, + { "print", CON_QUOTE }, + + { "dc", CON_DEFINECHEAT }, + { "ck", CON_CHEATKEYS }, + + { "qputs", CON_REDEFINEQUOTE }, + + { "espawn", CON_ESPAWNVAR }, + { "qspawn", CON_QSPAWNVAR }, + { "eqspawn", CON_EQSPAWNVAR }, + + { "eshoot", CON_ESHOOTVAR }, + { "zshoot", CON_ZSHOOTVAR }, + { "ezshoot", CON_EZSHOOTVAR }, + { "shoot", CON_SHOOTVAR }, + + { "findnearactor", CON_FINDNEARACTORVAR }, + { "findnearactor3d", CON_FINDNEARACTOR3DVAR }, + { "findnearactorz", CON_FINDNEARACTORZVAR }, + + { "findnearsprite", CON_FINDNEARSPRITEVAR }, + { "findnearsprite3d", CON_FINDNEARSPRITE3DVAR }, + { "findnearspritez", CON_FINDNEARSPRITEZVAR }, +}; + +#define NUMKEYWORDS (int32_t)ARRAY_SIZE(vm_keywords) + #endif #ifdef __cplusplus diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 665bfa52d..8f4e1f9ad 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -88,7 +88,7 @@ GAMEEXEC_STATIC void VM_Execute(int loop); #if !defined LUNATIC void VM_ScriptInfo(intptr_t const *ptr, int range) { - if (!apScript) + if (!apScript || (!vm.pSprite && !vm.pPlayer && g_currentEventExec == -1)) return; if (ptr) @@ -102,7 +102,11 @@ void VM_ScriptInfo(intptr_t const *ptr, int range) initprintf("%5d: %3d: ", (int32_t) (pScript - apScript), (int32_t) (pScript - ptr)); if (*pScript >> 12 && (*pScript & VM_INSTMASK) < CON_END) - initprintf("%5d %s\n", (int32_t) (*pScript >> 12), vm_keywords[*pScript & VM_INSTMASK].token); + { + for (size_t i=0; i < NUMKEYWORDS; ++i) + if (vm_keywords[i].val == (*pScript & VM_INSTMASK)) + initprintf("%5d %s\n", (int32_t) (*pScript >> 12), vm_keywords[i].token); + } else initprintf("%d\n", (int32_t) *pScript); }