Skip to content

Commit

Permalink
Force using the first frame for actions whose body frame count is <= 1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zhad3 committed Feb 5, 2022
1 parent 80f965c commit e26ad69
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e26ad69

Please sign in to comment.