Skip to content

Commit

Permalink
check the walk-animation lengths of the players in ValidateData
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Sep 25, 2024
1 parent 8b99650 commit 6030fe5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Source/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,9 @@ void ValidateData()
assert(monfiledata[MOFILE_SNAKE].moAnimFrameLen[MA_ATTACK] == 1); // required by MI_Rhino
assert(monfiledata[MOFILE_MAGMA].moAnimFrameLen[MA_SPECIAL] == 1); // required by MonDoRSpAttack
#ifdef DEBUG_DATA
// players
for (i = 0; i < NUM_CLASSES; i++)
assert(PlrGFXAnimLens[i][PA_WALK] == PlrGFXAnimLens[PC_WARRIOR][PA_WALK]); // required by StartWalk
// towners
for (i = 0; i < STORE_TOWNERS; i++) {
//const int(*gl)[2] = &GossipList[i];
Expand Down
5 changes: 1 addition & 4 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1304,12 +1304,9 @@ static bool StartWalk(int pnum)
return false;
}

#if DEBUG_MODE
for (i = 0; i < NUM_CLASSES; i++)
assert(PlrGFXAnimLens[i][PA_WALK] == PlrGFXAnimLens[PC_WARRIOR][PA_WALK]);
#endif
static_assert(TILE_WIDTH / TILE_HEIGHT == 2, "StartWalk relies on fix width/height ratio of the floor-tile.");
static_assert(PLR_WALK_SHIFT == MON_WALK_SHIFT, "To reuse MWVel in StartWalk, PLR_WALK_SHIFT must be equal to MON_WALK_SHIFT.");
// assert(PlrGFXAnimLens[plr._pClass][PA_WALK] == PlrGFXAnimLens[PC_WARRIOR][PA_WALK]);
assert(PlrGFXAnimLens[PC_WARRIOR][PA_WALK] <= lengthof(MWVel));
assert(PlrGFXAnimLens[PC_WARRIOR][PA_WALK] == 8); // StartWalk relies on fix walk-animation length to calculate the x/y velocity
mwi = MWVel[PlrGFXAnimLens[PC_WARRIOR][PA_WALK] - (plr._pIWalkSpeed == 0 ? 0 : (1 + plr._pIWalkSpeed)) - 1];
Expand Down

0 comments on commit 6030fe5

Please sign in to comment.