From e26ad69b909d2995d6ee9e5b5492b5e427d68a2c Mon Sep 17 00:00:00 2001 From: zhad3 Date: Sat, 5 Feb 2022 17:20:40 +0100 Subject: [PATCH] Force using the first frame for actions whose body frame count is <= 1 This affects only player sprites with actions 56-63 (freeze) 64-71 (dead) and 72-79 (freeze2). Freeze2 is still weird and it really begs the question if that action is actually used ingame. If this change will cause problems in the future I will revert it as the only other scenario where this would cause problems is for incorrectly created animated headgears. Closes #18. --- source/app.d | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/app.d b/source/app.d index de81f9c..8044b90 100644 --- a/source/app.d +++ b/source/app.d @@ -342,6 +342,13 @@ Sprite[] processNonPlayer(uint jobid, LogDg log, immutable Config config, Resolv const gender = (jobid - 6017) <= 9 ? Gender.female : Gender.male; + const numBodyFrames = jobsprite.act.numberOfFrames(config.action); + if (numBodyFrames <= 1) + { + // Force using the first frame for actions such as FREEZE, DEAD & FREEZE2 + requestFrame = 0; + } + // Attach head to mercenary. Gender is derived from the job id auto headspritepath = resolve.playerHeadSprite(jobid, config.head, gender); if (headspritepath.length > 0) @@ -477,6 +484,12 @@ Sprite[] processPlayer(uint jobid, LogDg log, immutable Config config, Resolver } interval = bodysprite.act.action(config.action).interval; + const numBodyFrames = bodysprite.act.numberOfFrames(config.action); + if (numBodyFrames <= 1) + { + // Force using the first frame for actions such as FREEZE, DEAD & FREEZE2 + requestFrame = 0; + } Sprite[] sprites; sprites.reserve(10);