From 9dac66b6f0e64c5a708a9f56956c3e5bfe62704c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 1 Aug 2020 14:19:37 +0200 Subject: [PATCH] - fudging for the broken FIRE animation. Unfortunately the only thing that can be done here from inside the engine is to increase the likelihood of the animation actually starting. Ideally the broken script should be replaced but with the way CON replacements are done this is not possible. --- source/games/duke/src/dispatch.cpp | 1 + source/games/duke/src/flags_d.cpp | 1 + source/games/duke/src/flags_r.cpp | 1 + source/games/duke/src/gameexec.cpp | 10 ++++++++++ source/games/duke/src/names.h | 1 + 5 files changed, 14 insertions(+) diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index f3d299a95..2055a4ad3 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -260,6 +260,7 @@ int TILE_MENUBAR; int TILE_ATOMICHEALTH; int TILE_FLOORSLIME; int TILE_JIBS6; +int TILE_FIRE; int TILE_WATERBUBBLE; int TILE_SMALLSMOKE; int TILE_BLOODPOOL; diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index f68ac40d5..8e81d3f67 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -259,6 +259,7 @@ void initactorflags_d() TILE_ATOMICHEALTH = ATOMICHEALTH; TILE_FLOORSLIME = FLOORSLIME; TILE_JIBS6 = JIBS6; + TILE_FIRE = FIRE; TILE_WATERBUBBLE = WATERBUBBLE; TILE_SMALLSMOKE = SMALLSMOKE; TILE_BLOODPOOL = BLOODPOOL; diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index d4dd3dbe6..42663e1df 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -229,6 +229,7 @@ void initactorflags_r() TILE_ATOMICHEALTH = ATOMICHEALTH; TILE_FLOORSLIME = FLOORSLIME; TILE_JIBS6 = JIBS6; + TILE_FIRE = FIRE; TILE_WATERBUBBLE = WATERBUBBLE; TILE_SMALLSMOKE = SMALLSMOKE; TILE_BLOODPOOL = BLOODPOOL; diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 751f79814..ba20fcf09 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -264,9 +264,19 @@ int ParseState::parse(void) switch (*insptr) { case concmd_ifrnd: + { insptr++; + // HACK ALERT! The fire animation uses a broken ifrnd setup to delay its start because original CON has no variables. + // But the chosen random value of 16/255 is too low and can cause delays of a second or more. + int spnum = sprite[g_i].picnum; + if (spnum == TILE_FIRE && g_t[4] == 0 && *insptr == 16) + { + parseifelse(rnd(64)); + break; + } parseifelse(rnd(*insptr)); break; + } case concmd_ifcanshoottarget: parseifelse(ifcanshoottarget(g_i, g_p, g_x)); break; diff --git a/source/games/duke/src/names.h b/source/games/duke/src/names.h index 1470010a2..f41e8f39d 100644 --- a/source/games/duke/src/names.h +++ b/source/games/duke/src/names.h @@ -30,6 +30,7 @@ extern int TILE_MENUBAR; extern int TILE_ATOMICHEALTH; extern int TILE_FLOORSLIME; extern int TILE_JIBS6; +extern int TILE_FIRE; extern int TILE_WATERBUBBLE; extern int TILE_SMALLSMOKE; extern int TILE_BLOODPOOL;