From b00266b47fda680ef96a9522fce22a4ee3727560 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 27 Jul 2017 09:13:21 +0000 Subject: [PATCH] CON-solidation Sorry for the shitty pun git-svn-id: https://svn.eduke32.com/eduke32@6382 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamedef.cpp | 875 ++++++++++++++++----------------- source/duke3d/src/gameexec.cpp | 364 +++----------- source/duke3d/src/gamevars.h | 2 + 3 files changed, 483 insertions(+), 758 deletions(-) diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 7b3e8ddd0..718d1f8af 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -173,416 +173,432 @@ const tokenmap_t altkeyw [] = { "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 }, }; -const char *keyw[] = -{ - "else", // 0 used with if checks - "actor", // 1 defines an actor - "addammo", // 2 adds ammo to a weapon - "ifrnd", // 3 checks against a randomizer - "enda", // 4 ends an actor definition - "ifcansee", // 5 checks if the player can see an object - "ifhitweapon", // 6 checks if an object was hit by a weapon - "action", // 7 defines an action if used outside a state or actor, otherwise triggers actor to perform action - "ifpdistl", // 8 checks if player distance is less than value - "ifpdistg", // 9 checks if player distance is more than value - "definelevelname", // 10 defines level name - "strength", // 11 sets health - "break", // 12 stops processing - "shoot", // 13 shoots a projectile - "palfrom", // 14 used for player screen shading effect, sets p->pals - "sound", // 15 plays a sound that was defined with definesound - "fall", // 16 causes actor to fall to sector floor height - "state", // 17 begins defining a state if used outside a state or actor, otherwise calls a state - "ends", // 18 ends defining a state - "define", // 19 defines a value - "return", // 20 - "ifai", // 21 checks if actor is currently performing a specific ai function - "killit", // 22 kills an actor - "addweapon", // 23 adds a weapon to the closest player - "ai", // 24 sets an ai function to be used by an actor - "addphealth", // 25 adds health to the player - "ifdead", // 26 checks if actor is dead - "ifsquished", // 27 checks if actor has been squished - "sizeto", // 28 gradually increases actor size until it matches parameters given - "{", // 29 used to indicate segments of code - "}", // 30 used to indicate segments of code - "spawn", // 31 spawns an actor - "move", // 32 - "ifwasweapon", // 33 - "ifaction", // 34 - "ifactioncount", // 35 - "resetactioncount", // 36 - "debris", // 37 - "pstomp", // 38 - "", // 39 was previously used to define the start of a comment block - "cstat", // 40 - "ifmove", // 41 - "resetplayer", // 42 - "ifonwater", // 43 - "ifinwater", // 44 - "ifcanshoottarget", // 45 - "ifcount", // 46 - "resetcount", // 47 - "addinventory", // 48 - "ifactornotstayput", // 49 - "hitradius", // 50 - "ifp", // 51 - "count", // 52 - "ifactor", // 53 - "music", // 54 - "include", // 55 - "ifstrength", // 56 - "definesound", // 57 - "guts", // 58 - "ifspawnedby", // 59 - "gamestartup", // 60 - "wackplayer", // 61 - "ifgapzl", // 62 - "ifhitspace", // 63 - "ifoutside", // 64 - "ifmultiplayer", // 65 - "operate", // 66 - "ifinspace", // 67 - "debug", // 68 - "endofgame", // 69 - "ifbulletnear", // 70 - "ifrespawn", // 71 - "iffloordistl", // 72 - "ifceilingdistl", // 73 - "spritepal", // 74 - "ifpinventory", // 75 - "betaname", // 76 - "cactor", // 77 - "ifphealthl", // 78 - "definequote", // 79 - "quote", // 80 - "ifinouterspace", // 81 - "ifnotmoving", // 82 - "respawnhitag", // 83 - "tip", // 84 - "ifspritepal", // 85 - "money", // 86 - "soundonce", // 87 - "addkills", // 88 - "stopsound", // 89 - "ifawayfromwall", // 90 - "ifcanseetarget", // 91 - "globalsound", // 92 - "lotsofglass", // 93 - "ifgotweaponce", // 94 - "getlastpal", // 95 - "pkick", // 96 - "mikesnd", // 97 - "useractor", // 98 - "sizeat", // 99 - "addstrength", // 100 [#] - "cstator", // 101 - "mail", // 102 - "paper", // 103 - "tossweapon", // 104 - "sleeptime", // 105 - "nullop", // 106 - "definevolumename", // 107 - "defineskillname", // 108 - "ifnosounds", // 109 - "clipdist", // 110 - "ifangdiffl", // 111 Last Duke3D 1.5 CON command - "gamevar", // 112 - "ifvarl", // 113 - "ifvarg", // 114 - "setvarvar", // 115 - "setvar", // 116 - "addvarvar", // 117 - "addvar", // 118 - "ifvarvarl", // 119 - "ifvarvarg", // 120 - "addlogvar", // 121 - "addlog", // 122 - "onevent", // 123 - "endevent", // 124 - "ifvare", // 125 - "ifvarvare", // 126 - "spgetlotag", // 127 - "spgethitag", // 128 - "sectgetlotag", // 129 - "sectgethitag", // 130 - "ifsound", // 131 - "gettexturefloor", // 132 - "gettextureceiling", // 133 - "inittimer", // 134 - "starttrack", // 135 - "randvar", // 136 - "enhanced", // 137 - "getangletotarget", // 138 - "getactorangle", // 139 - "setactorangle", // 140 - "mulvar", // 141 - "mulvarvar", // 142 - "divvar", // 143 - "divvarvar", // 144 - "modvar", // 145 - "modvarvar", // 146 - "andvar", // 147 - "andvarvar", // 148 - "orvar", // 149 - "orvarvar", // 150 - "getplayerangle", // 151 - "setplayerangle", // 152 - "lockplayer", // 153 - "setsector", // 154 - "getsector", // 155 - "setactor", // 156 - "getactor", // 157 - "setwall", // 158 - "getwall", // 159 - "findnearactor", // 160 - "findnearactorvar", // 161 - "setactorvar", // 162 - "getactorvar", // 163 - "espawn", // 164 - "getplayer", // 165 - "setplayer", // 166 - "sqrt", // 167 - "eventloadactor", // 168 - "espawnvar", // 169 - "getuserdef", // 170 - "setuserdef", // 171 - "subvarvar", // 172 - "subvar", // 173 - "ifvarn", // 174 - "ifvarvarn", // 175 - "ifvarand", // 176 - "ifvarvarand", // 177 - "myos", // 178 - "myospal", // 179 - "displayrand", // 180 - "sin", // 181 - "xorvarvar", // 182 - "xorvar", // 183 - "randvarvar", // 184 - "myosx", // 185 - "myospalx", // 186 - "gmaxammo", // 187 - "smaxammo", // 188 - "startlevel", // 189 - "eshoot", // 190 - "qspawn", // 191 - "rotatesprite", // 192 - "defineprojectile", // 193 - "spriteshadow", // 194 - "cos", // 195 - "eshootvar", // 196 - "findnearactor3d", // 197 - "findnearactor3dvar", // 198 - "flash", // 199 - "qspawnvar", // 200 - "eqspawn", // 201 - "eqspawnvar", // 202 - "minitext", // 203 - "gametext", // 204 - "digitalnumber", // 205 - "addweaponvar", // 206 - "setprojectile", // 207 - "angoff", // 208 - "updatesector", // 209 - "insertspriteq", // 210 - "angoffvar", // 211 - "whilevarn", // 212 - "switch", // 213 - "case", // 214 - "default", // 215 - "endswitch", // 216 - "shootvar", // 217 - "soundvar", // 218 - "findplayer", // 219 - "findotherplayer", // 220 - "activatebysector", // 221 sectnum, spriteid - "operatesectors", // 222 sectnum, spriteid - "operaterespawns", // 223 lotag - "operateactivators", // 224 lotag, player index - "operatemasterswitches", // 225 lotag - "checkactivatormotion", // 226 lotag - "zshoot", // 227 zvar projnum - "dist", // 228 sprite1 sprite2 - "ldist", // 229 sprite1 sprite2 - "shiftvarl", // 230 - "shiftvarr", // 231 - "spritenvg", // 232 - "getangle", // 233 - "whilevarvarn", // 234 - "hitscan", // 235 - "time", // 236 - "getplayervar", // 237 - "setplayervar", // 238 - "mulscale", // 239 - "setaspect", // 240 - "ezshoot", // 241 - "spritenoshade", // 242 - "movesprite", // 243 - "checkavailweapon", // 244 - "soundoncevar", // 245 - "updatesectorz", // 246 - "stopallsounds", // 247 - "ssp", // 248 - "stopsoundvar", // 249 - "displayrandvar", // 250 - "displayrandvarvar", // 251 - "checkavailinven", // 252 - "globalsoundvar", // 253 - "guniqhudid", // 254 - "getprojectile", // 255 - "getthisprojectile", // 256 - "setthisprojectile", // 257 - "definecheat", // 258 - "cheatkeys", // 259 - "userquote", // 260 - "precache", // 261 - "definegamefuncname", // 262 - "redefinequote", // 263 - "qsprintf", // 264 - "getpname", // 265 - "qstrcat", // 266 - "qstrcpy", // 267 - "setsprite", // 268 - "rotatepoint", // 269 - "dragpoint", // 270 - "getzrange", // 271 - "changespritestat", // 272 - "getceilzofslope", // 273 - "getflorzofslope", // 274 - "neartag", // 275 - "definegametype", // 276 - "changespritesect", // 277 - "spriteflags", // 278 - "savegamevar", // 279 - "readgamevar", // 280 - "findnearsprite", // 281 - "findnearspritevar", // 282 - "findnearsprite3d", // 283 - "findnearsprite3dvar", // 284 - "dynamicremap", // 285 - "setinput", // 286 - "getinput", // 287 - "save", // 288 - "cansee", // 289 Beginning EDuke32 SVN - "canseespr", // 290 - "findnearactorz", // 291 - "findnearactorzvar", // 292 - "findnearspritez", // 293 - "findnearspritezvar", // 294 - "zshootvar", // 295 - "ezshootvar", // 296 - "getcurraddress", // 297 - "jump", // 298 - "qstrlen", // 299 - "getincangle", // 300 - "quake", // 301 - "showview", // 302 - "headspritestat", // 303 - "prevspritestat", // 304 - "nextspritestat", // 305 - "headspritesect", // 306 - "prevspritesect", // 307 - "nextspritesect", // 308 - "getkeyname", // 309 - "qsubstr", // 310 - "gametextz", // 311 - "digitalnumberz", // 312 - "spritenopal", // 313 - "hitradiusvar", // 314 - "rotatesprite16", // 315 - "gamearray", // 316 - "setarray", // 317 - "resizearray", // 318 - "writearraytofile", // 319 - "readarrayfromfile", // 320 - "starttrackvar", // 321 - "qgetsysstr", // 322 - "getticks", // 323 - "gettspr", // 324 - "settspr", // 325 - "savemapstate", // 326 - "loadmapstate", // 327 - "clearmapstate", // 328 - "scriptsize", // 329 - "setgamename", // 330 - "cmenu", // 331 - "gettimedate", // 332 - "activatecheat", // 333 - "setgamepalette", // 334 - "setdefname", // 335 - "setcfgname", // 336 - "ifvaror", // 337 - "ifvarvaror", // 338 - "ifvarxor", // 339 - "ifvarvarxor", // 340 - "ifvareither", // 341 - "ifvarvareither", // 342 - "getarraysize", // 343 - "savenn", // 344 - "copy", // 345 - "inv", // 346 - "sectorofwall", // 347 - "qstrncat", // 348 - "ifactorsound", // 349 - "stopactorsound", // 350 - "ifclient", // 351 - "ifserver", // 352 - "sectsetinterpolation", // 353 - "sectclearinterpolation", // 354 - "clipmove", // 355 - "lineintersect", // 356 - "rayintersect", // 357 - "calchypotenuse", // 358 - "clipmovenoslide", // 359 - "includedefault", // 360 - "setactorsoundpitch", // 361 - "echo", // 362 - "showviewunbiased", // 363 - "rotatespritea", // 364 - "shadeto", // 365 - "endoflevel", // 366 - "ifplayersl", // 367 - "activate", // 368 - "qstrdim", // 369 - "screentext", // 370 - "dynamicsoundremap", // 371 - "screensound", // 372 - "getmusicposition", // 373 - "setmusicposition", // 374 - "undefinevolume", // 375 - "undefineskill", // 376 - "undefinelevel", // 377 - "startcutscene", // 378 - "ifcutscene", // 379 - "definevolumeflags", // 380 - "resetplayerflags", // 381 - "appendevent", // 382 - "defstate", // 383 - "shiftvarvarl", // 384 - "shiftvarvarr", // 385 - "ifvarvarle", // 386 - "ifvarvarge", // 387 - "ifvarvarboth", // 388 - "whilevarl", // 389 - "whilevarvarl", // 390 - "klabs", // 391 - "ifvarle", // 392 - "ifvarge", // 393 - "ifvarboth", // 394 - "movesector", // 395 - "for", // 396 - "nextsectorneighborz", // 397 - "clamp", // 398 - "ifplaybackon", // 399 - "divscale", // 400 - "scalevar", // 401 - "undefinegamefunc", // 402 - "getclosestcol", // 403 - "drawline256", // 404 - "drawlinergb", // 405 +const char *keyw[] = { + "else", // 0 used with if checks + "actor", // 1 defines an actor + "addammo", // 2 adds ammo to a weapon + "ifrnd", // 3 checks against a randomizer + "enda", // 4 ends an actor definition + "ifcansee", // 5 checks if the player can see an object + "ifhitweapon", // 6 checks if an object was hit by a weapon + "action", // 7 defines an action if used outside a state or actor, otherwise triggers actor to perform action + "ifpdistl", // 8 checks if player distance is less than value + "ifpdistg", // 9 checks if player distance is more than value + "definelevelname", // 10 defines level name + "strength", // 11 sets health + "break", // 12 stops processing + NULL, // 13 shoots a projectile + "palfrom", // 14 used for player screen shading effect, sets p->pals + "sound", // 15 plays a sound that was defined with definesound + "fall", // 16 causes actor to fall to sector floor height + "state", // 17 begins defining a state if used outside a state or actor, otherwise calls a state + "ends", // 18 ends defining a state + "define", // 19 defines a value + "return", // 20 + "ifai", // 21 checks if actor is currently performing a specific ai function + "killit", // 22 kills an actor + "addweapon", // 23 adds a weapon to the closest player + "ai", // 24 sets an ai function to be used by an actor + "addphealth", // 25 adds health to the player + "ifdead", // 26 checks if actor is dead + "ifsquished", // 27 checks if actor has been squished + "sizeto", // 28 gradually increases actor size until it matches parameters given + "{", // 29 used to indicate segments of code + "}", // 30 used to indicate segments of code + "spawn", // 31 spawns an actor + "move", // 32 + "ifwasweapon", // 33 + "ifaction", // 34 + "ifactioncount", // 35 + "resetactioncount", // 36 + "debris", // 37 + "pstomp", // 38 + "", // 39 was previously used to define the start of a comment block + "cstat", // 40 + "ifmove", // 41 + "resetplayer", // 42 + "ifonwater", // 43 + "ifinwater", // 44 + "ifcanshoottarget", // 45 + "ifcount", // 46 + "resetcount", // 47 + "addinventory", // 48 + "ifactornotstayput", // 49 + "hitradius", // 50 + "ifp", // 51 + "count", // 52 + "ifactor", // 53 + "music", // 54 + "include", // 55 + "ifstrength", // 56 + "definesound", // 57 + "guts", // 58 + "ifspawnedby", // 59 + "gamestartup", // 60 + "wackplayer", // 61 + "ifgapzl", // 62 + "ifhitspace", // 63 + "ifoutside", // 64 + "ifmultiplayer", // 65 + "operate", // 66 + "ifinspace", // 67 + "debug", // 68 + "endofgame", // 69 + "ifbulletnear", // 70 + "ifrespawn", // 71 + "iffloordistl", // 72 + "ifceilingdistl", // 73 + "spritepal", // 74 + "ifpinventory", // 75 + "betaname", // 76 + "cactor", // 77 + "ifphealthl", // 78 + "definequote", // 79 + "quote", // 80 + "ifinouterspace", // 81 + "ifnotmoving", // 82 + "respawnhitag", // 83 + "tip", // 84 + "ifspritepal", // 85 + "money", // 86 + "soundonce", // 87 + "addkills", // 88 + "stopsound", // 89 + "ifawayfromwall", // 90 + "ifcanseetarget", // 91 + "globalsound", // 92 + "lotsofglass", // 93 + "ifgotweaponce", // 94 + "getlastpal", // 95 + "pkick", // 96 + "mikesnd", // 97 + "useractor", // 98 + "sizeat", // 99 + "addstrength", // 100 [#] + "cstator", // 101 + "mail", // 102 + "paper", // 103 + "tossweapon", // 104 + "sleeptime", // 105 + "nullop", // 106 + "definevolumename", // 107 + "defineskillname", // 108 + "ifnosounds", // 109 + "clipdist", // 110 + "ifangdiffl", // 111 Last Duke3D 1.5 CON command + "gamevar", // 112 + "ifvarl", // 113 + "ifvarg", // 114 + "setvarvar", // 115 + "setvar", // 116 + "addvarvar", // 117 + "addvar", // 118 + "ifvarvarl", // 119 + "ifvarvarg", // 120 + "addlogvar", // 121 + "addlog", // 122 + "onevent", // 123 + "endevent", // 124 + "ifvare", // 125 + "ifvarvare", // 126 + "spgetlotag", // 127 + "spgethitag", // 128 + "sectgetlotag", // 129 + "sectgethitag", // 130 + "ifsound", // 131 + "gettexturefloor", // 132 + "gettextureceiling", // 133 + "inittimer", // 134 + "starttrack", // 135 + "randvar", // 136 + "enhanced", // 137 + "getangletotarget", // 138 + "getactorangle", // 139 + "setactorangle", // 140 + "mulvar", // 141 + "mulvarvar", // 142 + "divvar", // 143 + "divvarvar", // 144 + "modvar", // 145 + "modvarvar", // 146 + "andvar", // 147 + "andvarvar", // 148 + "orvar", // 149 + "orvarvar", // 150 + "getplayerangle", // 151 + "setplayerangle", // 152 + "lockplayer", // 153 + "setsector", // 154 + "getsector", // 155 + "setactor", // 156 + "getactor", // 157 + "setwall", // 158 + "getwall", // 159 + NULL, // 160 + "findnearactorvar", // 161 + "setactorvar", // 162 + "getactorvar", // 163 + NULL, // 164 + "getplayer", // 165 + "setplayer", // 166 + "sqrt", // 167 + "eventloadactor", // 168 + "espawnvar", // 169 + "getuserdef", // 170 + "setuserdef", // 171 + "subvarvar", // 172 + "subvar", // 173 + "ifvarn", // 174 + "ifvarvarn", // 175 + "ifvarand", // 176 + "ifvarvarand", // 177 + "myos", // 178 + "myospal", // 179 + "displayrand", // 180 + "sin", // 181 + "xorvarvar", // 182 + "xorvar", // 183 + "randvarvar", // 184 + "myosx", // 185 + "myospalx", // 186 + "gmaxammo", // 187 + "smaxammo", // 188 + "startlevel", // 189 + NULL, // 190 Beginning of EDuke32 + NULL, // 191 + "rotatesprite", // 192 + "defineprojectile", // 193 + "spriteshadow", // 194 + "cos", // 195 + "eshootvar", // 196 + NULL, // 197 + "findnearactor3dvar", // 198 + "flash", // 199 + "qspawnvar", // 200 + NULL, // 201 + "eqspawnvar", // 202 + "minitext", // 203 + "gametext", // 204 + "digitalnumber", // 205 + "addweaponvar", // 206 + "setprojectile", // 207 + "angoff", // 208 + "updatesector", // 209 + "insertspriteq", // 210 + "angoffvar", // 211 + "whilevarn", // 212 + "switch", // 213 + "case", // 214 + "default", // 215 + "endswitch", // 216 + "shootvar", // 217 + "soundvar", // 218 + "findplayer", // 219 + "findotherplayer", // 220 + "activatebysector", // 221 sectnum, spriteid + "operatesectors", // 222 sectnum, spriteid + "operaterespawns", // 223 lotag + "operateactivators", // 224 lotag, player index + "operatemasterswitches", // 225 lotag + "checkactivatormotion", // 226 lotag + NULL, // 227 zvar projnum + "dist", // 228 sprite1 sprite2 + "ldist", // 229 sprite1 sprite2 + "shiftvarl", // 230 + "shiftvarr", // 231 + "spritenvg", // 232 + "getangle", // 233 + "whilevarvarn", // 234 + "hitscan", // 235 + "time", // 236 + "getplayervar", // 237 + "setplayervar", // 238 + "mulscale", // 239 + "setaspect", // 240 + NULL, // 241 + "spritenoshade", // 242 + "movesprite", // 243 + "checkavailweapon", // 244 + "soundoncevar", // 245 + "updatesectorz", // 246 + "stopallsounds", // 247 + "ssp", // 248 + "stopsoundvar", // 249 + "displayrandvar", // 250 + "displayrandvarvar", // 251 + "checkavailinven", // 252 + "globalsoundvar", // 253 + "guniqhudid", // 254 + "getprojectile", // 255 + "getthisprojectile", // 256 + "setthisprojectile", // 257 + "definecheat", // 258 + "cheatkeys", // 259 + "userquote", // 260 + "precache", // 261 + "definegamefuncname", // 262 + "redefinequote", // 263 + "qsprintf", // 264 + "getpname", // 265 + "qstrcat", // 266 + "qstrcpy", // 267 + "setsprite", // 268 + "rotatepoint", // 269 + "dragpoint", // 270 + "getzrange", // 271 + "changespritestat", // 272 + "getceilzofslope", // 273 + "getflorzofslope", // 274 + "neartag", // 275 + "definegametype", // 276 + "changespritesect", // 277 + "spriteflags", // 278 + "savegamevar", // 279 + "readgamevar", // 280 + NULL, // 281 + "findnearspritevar", // 282 + NULL, // 283 + "findnearsprite3dvar", // 284 + "dynamicremap", // 285 + "setinput", // 286 + "getinput", // 287 + "save", // 288 + "cansee", // 289 Beginning of EDuke32 SVN + "canseespr", // 290 + NULL, // 291 + "findnearactorzvar", // 292 + NULL, // 293 + "findnearspritezvar", // 294 + "zshootvar", // 295 + "ezshootvar", // 296 + "getcurraddress", // 297 + "jump", // 298 + "qstrlen", // 299 + "getincangle", // 300 + "quake", // 301 + "showview", // 302 + "headspritestat", // 303 + "prevspritestat", // 304 + "nextspritestat", // 305 + "headspritesect", // 306 + "prevspritesect", // 307 + "nextspritesect", // 308 + "getkeyname", // 309 + "qsubstr", // 310 + "gametextz", // 311 + "digitalnumberz", // 312 + "spritenopal", // 313 + "hitradiusvar", // 314 + "rotatesprite16", // 315 + "gamearray", // 316 + "setarray", // 317 + "resizearray", // 318 + "writearraytofile", // 319 + "readarrayfromfile", // 320 + "starttrackvar", // 321 + "qgetsysstr", // 322 + "getticks", // 323 + "gettspr", // 324 + "settspr", // 325 + "savemapstate", // 326 + "loadmapstate", // 327 + "clearmapstate", // 328 + "scriptsize", // 329 + "setgamename", // 330 + "cmenu", // 331 + "gettimedate", // 332 + "activatecheat", // 333 + "setgamepalette", // 334 + "setdefname", // 335 + "setcfgname", // 336 + "ifvaror", // 337 + "ifvarvaror", // 338 + "ifvarxor", // 339 + "ifvarvarxor", // 340 + "ifvareither", // 341 + "ifvarvareither", // 342 + "getarraysize", // 343 + "savenn", // 344 + "copy", // 345 + "inv", // 346 + "sectorofwall", // 347 + "qstrncat", // 348 + "ifactorsound", // 349 + "stopactorsound", // 350 + "ifclient", // 351 + "ifserver", // 352 + "sectsetinterpolation", // 353 + "sectclearinterpolation", // 354 + "clipmove", // 355 + "lineintersect", // 356 + "rayintersect", // 357 + "calchypotenuse", // 358 + "clipmovenoslide", // 359 + "includedefault", // 360 + "setactorsoundpitch", // 361 + "echo", // 362 + "showviewunbiased", // 363 + "rotatespritea", // 364 + "shadeto", // 365 + "endoflevel", // 366 + "ifplayersl", // 367 + "activate", // 368 + "qstrdim", // 369 + "screentext", // 370 + "dynamicsoundremap", // 371 + "screensound", // 372 + "getmusicposition", // 373 + "setmusicposition", // 374 + "undefinevolume", // 375 + "undefineskill", // 376 + "undefinelevel", // 377 + "startcutscene", // 378 + "ifcutscene", // 379 + "definevolumeflags", // 380 + "resetplayerflags", // 381 + "appendevent", // 382 + "defstate", // 383 + "shiftvarvarl", // 384 + "shiftvarvarr", // 385 + "ifvarvarle", // 386 + "ifvarvarge", // 387 + "ifvarvarboth", // 388 + "whilevarl", // 389 + "whilevarvarl", // 390 + "klabs", // 391 + "ifvarle", // 392 + "ifvarge", // 393 + "ifvarboth", // 394 + "movesector", // 395 + "for", // 396 + "nextsectorneighborz", // 397 + "clamp", // 398 + "ifplaybackon", // 399 + "divscale", // 400 + "scalevar", // 401 + "undefinegamefunc", // 402 + "getclosestcol", // 403 + "drawline256", // 404 + "drawlinergb", // 405 "" }; #endif @@ -1315,7 +1331,7 @@ void C_InitHashes() inithashnames(); initsoundhashnames(); - for (i=0; i - // gets the sprite ID of the nearest actor within max dist - // that is of into - // -1 for none found - - C_GetNextValue(LABEL_DEFINE); // get - C_GetNextValue(LABEL_DEFINE); // get maxdist - - switch (tw) - { - case CON_FINDNEARACTORZ: - case CON_FINDNEARSPRITEZ: - C_GetNextValue(LABEL_DEFINE); - default: - break; - } - - // target var - // get the ID of the DEF - C_GetNextVarType(GAMEVAR_READONLY); - continue; - } - case CON_FINDNEARACTORVAR: case CON_FINDNEARACTOR3DVAR: case CON_FINDNEARSPRITEVAR: @@ -4184,8 +4165,6 @@ DO_DEFSTATE: continue; case CON_RANDVAR: - case CON_ZSHOOT: - case CON_EZSHOOT: case CON_SETVAR: case CON_ADDVAR: case CON_SUBVAR: @@ -4207,9 +4186,7 @@ DO_DEFSTATE: // adds const1 to var1 (const1 can be negative...) //printf("Found [add|set]var at line= %d\n",g_lineNumber); - if (tw != CON_ZSHOOT && tw != CON_EZSHOOT) - C_GetNextVarType(GAMEVAR_READONLY); - else C_GetNextVar(); + C_GetNextVarType(GAMEVAR_READONLY); C_GetNextValue(LABEL_DEFINE); // the number to check against... diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 99ff26ee5..b81ff90c3 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -1601,11 +1601,6 @@ skip_check: vm.pSprite->yrepeat = (uint8_t)*insptr++; continue; - case CON_SHOOT: - insptr++; - A_Shoot(vm.spriteNum,*insptr++); - continue; - case CON_SOUNDONCE: if (EDUKE32_PREDICT_FALSE((unsigned)*(++insptr) >= MAXSOUNDS)) { @@ -2536,22 +2531,6 @@ nullquote: } case CON_LDIST: - insptr++; - { - int const out = *insptr++; - vec2_t in; - Gv_FillWithVars(in); - - if (EDUKE32_PREDICT_FALSE((unsigned)in.x >= MAXSPRITES || (unsigned)in.y >= MAXSPRITES)) - { - CON_ERRPRINTF("invalid sprite %d, %d\n", in.x, in.y); - continue; - } - - Gv_SetVarX(out, ldist(&sprite[in.x], &sprite[in.y])); - continue; - } - case CON_DIST: insptr++; { @@ -2565,47 +2544,29 @@ nullquote: continue; } - Gv_SetVarX(out, dist(&sprite[in.x], &sprite[in.y])); + Gv_SetVarX(out, (tw == CON_LDIST ? ldist : dist)(&sprite[in.x], &sprite[in.y])); continue; } case CON_GETANGLE: - insptr++; - { - int const out = *insptr++; - vec2_t in; - Gv_FillWithVars(in); - Gv_SetVarX(out, getangle(in.x, in.y)); - continue; - } - case CON_GETINCANGLE: insptr++; { int const out = *insptr++; vec2_t in; Gv_FillWithVars(in); - Gv_SetVarX(out, G_GetAngleDelta(in.x, in.y)); + Gv_SetVarX(out, (tw == CON_GETANGLE ? getangle : G_GetAngleDelta)(in.x, in.y)); continue; } case CON_MULSCALE: - insptr++; - { - int const out = *insptr++; - vec3_t in; - Gv_FillWithVars(in); - Gv_SetVarX(out, mulscale(in.x, in.y, in.z)); - continue; - } - case CON_DIVSCALE: insptr++; { int const out = *insptr++; vec3_t in; Gv_FillWithVars(in); - Gv_SetVarX(out, divscale(in.x, in.y, in.z)); + Gv_SetVarX(out, (tw == CON_MULSCALE ? mulscale : divscale)(in.x, in.y, in.z)); continue; } @@ -2674,62 +2635,6 @@ nullquote: continue; } - case CON_ESPAWN: - case CON_EQSPAWN: - case CON_QSPAWN: - insptr++; - - { - if (EDUKE32_PREDICT_FALSE((unsigned)vm.pSprite->sectnum >= (unsigned)numsectors)) - { - CON_ERRPRINTF("invalid sector %d\n", vm.pUSprite->sectnum); - insptr++; - continue; - } - - int const spriteNum = A_Spawn(vm.spriteNum,*insptr++); - - switch (tw) - { - case CON_EQSPAWN: - if (spriteNum != -1) - A_AddToDeleteQueue(spriteNum); - fallthrough__; - case CON_ESPAWN: - aGameVars[g_returnVarID].global = spriteNum; - break; - case CON_QSPAWN: - if (spriteNum != -1) - A_AddToDeleteQueue(spriteNum); - break; - } - } - continue; - - case CON_ESHOOT: - case CON_EZSHOOT: - case CON_ZSHOOT: - insptr++; - { - // NOTE: (int16_t) cast because we want to exclude that - // SHOOT_HARDCODED_ZVEL is passed. - int const zvel = (tw == CON_ESHOOT) ? - SHOOT_HARDCODED_ZVEL : (int16_t)Gv_GetVarX(*insptr++); - - if (EDUKE32_PREDICT_FALSE((unsigned)vm.pSprite->sectnum >= (unsigned)numsectors)) - { - CON_ERRPRINTF("invalid sector %d\n", vm.pUSprite->sectnum); - insptr++; - continue; - } - - int const spriteNum = A_ShootWithZvel(vm.spriteNum,*insptr++,zvel); - - if (tw != CON_ZSHOOT) - aGameVars[g_returnVarID].global = spriteNum; - } - continue; - case CON_SHOOTVAR: case CON_ESHOOTVAR: insptr++; @@ -2981,7 +2886,7 @@ nullquote: } v; Gv_FillWithVars(v); - int32_t const nZoom = (tw == CON_DIGITALNUMBERZ) ? Gv_GetVarX(*insptr++) : 65536; + int32_t const nZoom = (tw == CON_DIGITALNUMBERZ) ? Gv_GetVarX(*insptr++) : 65536; // NOTE: '-' not taken into account, but we have rotatesprite() bound check now anyway if (EDUKE32_PREDICT_FALSE(v.tilenum < 0 || v.tilenum+9 >= MAXTILES)) @@ -3134,17 +3039,10 @@ nullquote: int const intzvar = *insptr++; int const retvar = *insptr++; vec3_t in; - int ret = (tw == CON_LINEINTERSECT) - ? lintersect(v.vec[0].x, v.vec[0].y, v.vec[0].z, - v.vec[1].x, v.vec[1].y, v.vec[1].z, - v.vec2[0].x, v.vec2[0].y, - v.vec2[1].x, v.vec2[1].y, - &in.x, &in.y, &in.z) - : rayintersect(v.vec[0].x, v.vec[0].y, v.vec[0].z, - v.vec[1].x, v.vec[1].y, v.vec[1].z, - v.vec2[0].x, v.vec2[0].y, - v.vec2[1].x, v.vec2[1].y, - &in.x, &in.y, &in.z); + + int ret = ((tw == CON_LINEINTERSECT) ? lintersect : rayintersect)(v.vec[0].x, v.vec[0].y, v.vec[0].z, v.vec[1].x, + v.vec[1].y, v.vec[1].z, v.vec2[0].x, v.vec2[0].y, + v.vec2[1].x, v.vec2[1].y, &in.x, &in.y, &in.z); Gv_SetVarX(retvar, ret); @@ -4005,27 +3903,20 @@ finish_qsprintf: case CON_SETSECTOR: insptr++; { - tw = *insptr++; - + int const sectNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : sprite[vm.spriteNum].sectnum; int const labelNum = *insptr++; - int const lVar2 = *insptr++; - int const sectNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : sprite[vm.spriteNum].sectnum; - int const nValue = Gv_GetVarX(lVar2); - VM_SetSector(sectNum, labelNum, nValue); + VM_SetSector(sectNum, labelNum, Gv_GetVarX(*insptr++)); continue; } case CON_GETSECTOR: insptr++; { - tw = *insptr++; - + int const sectNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : sprite[vm.spriteNum].sectnum; int const labelNum = *insptr++; - int const lVar2 = *insptr++; - int const sectNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : sprite[vm.spriteNum].sectnum; - Gv_SetVarX(lVar2, VM_GetSector(sectNum, labelNum)); + Gv_SetVarX(*insptr++, VM_GetSector(sectNum, labelNum)); continue; } @@ -4038,72 +3929,6 @@ finish_qsprintf: continue; } - case CON_FINDNEARACTOR: - case CON_FINDNEARSPRITE: - case CON_FINDNEARACTOR3D: - case CON_FINDNEARSPRITE3D: - insptr++; - { - // syntax findnearactorvar - // gets the sprite ID of the nearest actor within max dist - // that is of into - // -1 for none found - // - int const findPicnum = *insptr++; - int const maxDist = *insptr++; - int const returnVar = *insptr++; - int foundSprite = -1; - int findStatnum = MAXSTATUS - 1; - int spriteNum; - - if (tw == CON_FINDNEARACTOR || tw == CON_FINDNEARACTOR3D) - findStatnum = 1; - - if (tw==CON_FINDNEARSPRITE3D || tw==CON_FINDNEARACTOR3D) - { - do - { - spriteNum=headspritestat[findStatnum]; // all sprites - while (spriteNum>=0) - { - if (sprite[spriteNum].picnum == findPicnum && spriteNum != vm.spriteNum && dist(&sprite[vm.spriteNum], &sprite[spriteNum]) < maxDist) - { - foundSprite=spriteNum; - spriteNum = MAXSPRITES; - break; - } - spriteNum = nextspritestat[spriteNum]; - } - if (spriteNum == MAXSPRITES || tw == CON_FINDNEARACTOR3D) - break; - } - while (findStatnum--); - Gv_SetVarX(returnVar, foundSprite); - continue; - } - - do - { - spriteNum=headspritestat[findStatnum]; // all sprites - while (spriteNum>=0) - { - if (sprite[spriteNum].picnum == findPicnum && spriteNum != vm.spriteNum && ldist(&sprite[vm.spriteNum], &sprite[spriteNum]) < maxDist) - { - foundSprite=spriteNum; - spriteNum = MAXSPRITES; - break; - } - spriteNum = nextspritestat[spriteNum]; - } - - if (spriteNum == MAXSPRITES || tw == CON_FINDNEARACTOR) - break; - } - while (findStatnum--); - Gv_SetVarX(returnVar, foundSprite); - continue; - } - case CON_FINDNEARACTORVAR: case CON_FINDNEARSPRITEVAR: case CON_FINDNEARACTOR3DVAR: @@ -4220,54 +4045,6 @@ finish_qsprintf: continue; } - case CON_FINDNEARACTORZ: - case CON_FINDNEARSPRITEZ: - insptr++; - { - // syntax findnearactorvar - // gets the sprite ID of the nearest actor within max dist - // that is of into - // -1 for none found - // - int const findPicnum = *insptr++; - int const maxDist = *insptr++; - int const maxZDist = *insptr++; - int const returnVar = *insptr++; - int foundSprite = -1; - int findStatnum = MAXSTATUS - 1; - - do - { - int spriteNum = headspritestat[tw == CON_FINDNEARACTORZ ? 1 : findStatnum]; // all sprites - - if (spriteNum == -1) - continue; - do - { - if (sprite[spriteNum].picnum == findPicnum && spriteNum != vm.spriteNum) - { - if (ldist(&sprite[vm.spriteNum], &sprite[spriteNum]) < maxDist) - { - if (klabs(sprite[vm.spriteNum].z-sprite[spriteNum].z) < maxZDist) - { - foundSprite=spriteNum; - spriteNum = MAXSPRITES; - break; - } - } - } - spriteNum = nextspritestat[spriteNum]; - } - while (spriteNum>=0); - - if (tw==CON_FINDNEARACTORZ || spriteNum == MAXSPRITES) - break; - } - while (findStatnum--); - Gv_SetVarX(returnVar, foundSprite); - continue; - } - case CON_FINDPLAYER: insptr++; aGameVars[g_returnVarID].global = A_FindPlayer(&sprite[vm.spriteNum], &tw); @@ -4283,23 +4060,18 @@ finish_qsprintf: case CON_SETPLAYER: insptr++; { - tw = *insptr++; - - int const playerNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.playerNum; + int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.playerNum; int const labelNum = *insptr++; int const lParm2 = (PlayerLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; - int const nValue = Gv_GetVarX(*insptr++); - VM_SetPlayer(playerNum, labelNum, lParm2, nValue); + VM_SetPlayer(playerNum, labelNum, lParm2, Gv_GetVarX(*insptr++)); continue; } case CON_GETPLAYER: insptr++; { - tw = *insptr++; - - int const playerNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.playerNum; + int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.playerNum; int const labelNum = *insptr++; int const lParm2 = (PlayerLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; @@ -4310,9 +4082,7 @@ finish_qsprintf: case CON_GETINPUT: insptr++; { - tw = *insptr++; - - int const playerNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.playerNum; + int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.playerNum; int const labelNum = *insptr++; Gv_SetVarX(*insptr++, VM_GetPlayerInput(playerNum, labelNum)); @@ -4322,13 +4092,10 @@ finish_qsprintf: case CON_SETINPUT: insptr++; { - tw = *insptr++; - - int const playerNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.playerNum; + int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.playerNum; int const labelNum = *insptr++; - int const iSet = Gv_GetVarX(*insptr++); - VM_SetPlayerInput(playerNum, labelNum, iSet); + VM_SetPlayerInput(playerNum, labelNum, Gv_GetVarX(*insptr++)); continue; } @@ -4407,6 +4174,7 @@ finish_qsprintf: if (lVar2 == MAXGAMEVARS || lVar2 & ((MAXGAMEVARS << 2) | (MAXGAMEVARS << 3))) insptr++; + continue; } @@ -4450,9 +4218,7 @@ finish_qsprintf: case CON_SETACTOR: insptr++; { - tw = *insptr++; - - int const spriteNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.spriteNum; + int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.spriteNum; int const labelNum = *insptr++; int const lParm2 = (ActorLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; @@ -4463,9 +4229,7 @@ finish_qsprintf: case CON_GETACTOR: insptr++; { - tw = *insptr++; - - int const spriteNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.spriteNum; + int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.spriteNum; int const labelNum = *insptr++; int const lParm2 = (ActorLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVarX(*insptr++) : 0; @@ -4476,9 +4240,7 @@ finish_qsprintf: case CON_SETTSPR: insptr++; { - tw = *insptr++; - - int const spriteNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.spriteNum; + int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.spriteNum; int const labelNum = *insptr++; VM_SetTsprite(spriteNum, labelNum, Gv_GetVarX(*insptr++)); @@ -4488,9 +4250,7 @@ finish_qsprintf: case CON_GETTSPR: insptr++; { - tw = *insptr++; - - int const spriteNum = (tw != g_thisActorVarID) ? Gv_GetVarX(tw) : vm.spriteNum; + int const spriteNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVarX(*(insptr - 1)) : vm.spriteNum; int const labelNum = *insptr++; Gv_SetVarX(*insptr++, VM_GetTsprite(spriteNum, labelNum)); @@ -4514,19 +4274,6 @@ finish_qsprintf: continue; case CON_CHECKAVAILWEAPON: - insptr++; - tw = (*insptr != g_thisActorVarID) ? Gv_GetVarX(*insptr) : vm.playerNum; - insptr++; - - if (EDUKE32_PREDICT_FALSE((unsigned)tw >= (unsigned)g_mostConcurrentPlayers)) - { - CON_ERRPRINTF("invalid player %d\n", tw); - continue; - } - - P_CheckWeapon(g_player[tw].ps); - continue; - case CON_CHECKAVAILINVEN: insptr++; tw = (*insptr != g_thisActorVarID) ? Gv_GetVarX(*insptr) : vm.playerNum; @@ -4538,7 +4285,11 @@ finish_qsprintf: continue; } - P_SelectNextInvItem(g_player[tw].ps); + if (tw == CON_CHECKAVAILWEAPON) + P_CheckWeapon(g_player[tw].ps); + else + P_SelectNextInvItem(g_player[tw].ps); + continue; case CON_GETPLAYERANGLE: @@ -4642,11 +4393,15 @@ finish_qsprintf: { int numBytes = numElements * Gv_GetArrayElementSize(arrayNum); - Baligned_free(aGameArrays[arrayNum].pValues); + aGameArrays[arrayNum].size = numBytes ? numElements : kfilelength(kFile); - aGameArrays[arrayNum].size = numBytes ? numElements : kfilelength(kFile); - aGameArrays[arrayNum].pValues = (intptr_t *)Xaligned_alloc(ACTOR_VAR_ALIGNMENT, Gv_GetArrayAllocSize(arrayNum)); - numBytes = Gv_GetArrayAllocSize(arrayNum); + if (numBytes != Gv_GetArrayAllocSize(arrayNum)) + { + Baligned_free(aGameArrays[arrayNum].pValues); + aGameArrays[arrayNum].pValues = (intptr_t *) Xaligned_alloc(ACTOR_VAR_ALIGNMENT, Gv_GetArrayAllocSize(arrayNum)); + } + + numBytes = Gv_GetArrayAllocSize(arrayNum); switch (aGameArrays[arrayNum].flags & GAMEARRAY_TYPE_MASK) { @@ -4665,7 +4420,7 @@ finish_qsprintf: } #endif default: - kread(kFile, aGameArrays[arrayNum].pValues, numBytes); + kread(kFile, aGameArrays[arrayNum].pValues, Gv_GetArrayAllocSize(arrayNum)); break; } } @@ -5080,38 +4835,26 @@ finish_qsprintf: case CON_SHIFTVARL: insptr++; - if ((aGameVars[*insptr].flags & (GAMEVAR_USER_MASK|GAMEVAR_PTR_MASK)) == 0) - { - aGameVars[*insptr].global <<= *(insptr+1); - insptr += 2; - continue; - } - Gv_SetVarX(*insptr, Gv_GetVarX(*insptr) << *(insptr+1)); + Gv_ShiftVarL(*insptr, *(insptr+1)); insptr += 2; continue; case CON_SHIFTVARR: insptr++; - if ((aGameVars[*insptr].flags & (GAMEVAR_USER_MASK|GAMEVAR_PTR_MASK)) == 0) - { - aGameVars[*insptr].global >>= *(insptr+1); - insptr += 2; - continue; - } - Gv_SetVarX(*insptr, Gv_GetVarX(*insptr) >> *(insptr+1)); + Gv_ShiftVarR(*insptr, *(insptr+1)); insptr += 2; continue; case CON_SHIFTVARVARL: insptr++; tw = *insptr++; - Gv_SetVarX(tw, Gv_GetVarX(tw) << Gv_GetVarX(*insptr++)); + Gv_ShiftVarL(tw, Gv_GetVarX(*insptr++)); continue; case CON_SHIFTVARVARR: insptr++; tw = *insptr++; - Gv_SetVarX(tw, Gv_GetVarX(tw) >> Gv_GetVarX(*insptr++)); + Gv_ShiftVarR(tw, Gv_GetVarX(*insptr++)); continue; case CON_SIN: @@ -5559,11 +5302,17 @@ finish_qsprintf: switch (*insptr++) { - case GET_STEROIDS: tw = (pPlayer->inv_amount[GET_STEROIDS] != *insptr); break; - case GET_SHIELD: tw = (pPlayer->inv_amount[GET_SHIELD] != pPlayer->max_shield_amount); break; - case GET_SCUBA: tw = (pPlayer->inv_amount[GET_SCUBA] != *insptr); break; - case GET_HOLODUKE: tw = (pPlayer->inv_amount[GET_HOLODUKE] != *insptr); break; - case GET_JETPACK: tw = (pPlayer->inv_amount[GET_JETPACK] != *insptr); break; + case GET_STEROIDS: + case GET_SHIELD: + case GET_SCUBA: + case GET_HOLODUKE: + case GET_HEATS: + case GET_FIRSTAID: + case GET_BOOTS: + case GET_JETPACK: + tw = (pPlayer->inv_amount[*(insptr - 1)] != *insptr); + break; + case GET_ACCESS: switch (vm.pSprite->pal) { @@ -5572,9 +5321,6 @@ finish_qsprintf: case 23: tw = (pPlayer->got_access & 4); break; } break; - case GET_HEATS: tw = (pPlayer->inv_amount[GET_HEATS] != *insptr); break; - case GET_FIRSTAID: tw = (pPlayer->inv_amount[GET_FIRSTAID] != *insptr); break; - case GET_BOOTS: tw = (pPlayer->inv_amount[GET_BOOTS] != *insptr); break; default: tw = 0; CON_ERRPRINTF("invalid inventory item %d\n", (int32_t) * (insptr - 1)); } @@ -5587,7 +5333,7 @@ finish_qsprintf: if (cansee(vm.pSprite->x, vm.pSprite->y, vm.pSprite->z - ZOFFSET6, vm.pSprite->sectnum, pPlayer->pos.x, pPlayer->pos.y, pPlayer->pos.z + ZOFFSET2, sprite[pPlayer->i].sectnum)) { - int32_t numPlayers = g_mostConcurrentPlayers - 1; + int numPlayers = g_mostConcurrentPlayers - 1; for (; numPlayers >= 0; --numPlayers) { @@ -5600,8 +5346,8 @@ finish_qsprintf: if (pPlayer->weapon_pos == 0) pPlayer->weapon_pos = -1; - pPlayer->actorsqu = vm.spriteNum; - pPlayer->knee_incs = 1; + pPlayer->actorsqu = vm.spriteNum; + pPlayer->knee_incs = 1; } } continue; diff --git a/source/duke3d/src/gamevars.h b/source/duke3d/src/gamevars.h index ed8926e56..c82917b77 100644 --- a/source/duke3d/src/gamevars.h +++ b/source/duke3d/src/gamevars.h @@ -222,6 +222,8 @@ VM_GAMEVAR_OPERATOR(Gv_ModVar, %=) VM_GAMEVAR_OPERATOR(Gv_AndVar, &=) VM_GAMEVAR_OPERATOR(Gv_XorVar, ^=) VM_GAMEVAR_OPERATOR(Gv_OrVar, |=) +VM_GAMEVAR_OPERATOR(Gv_ShiftVarL, <<=) +VM_GAMEVAR_OPERATOR(Gv_ShiftVarR, >>=) #undef VM_GAMEVAR_OPERATOR