From 6030fe56fa0ff38e93a138a35991750b2e6790b1 Mon Sep 17 00:00:00 2001 From: pionere Date: Wed, 25 Sep 2024 09:29:54 +0200 Subject: [PATCH] check the walk-animation lengths of the players in ValidateData --- Source/debug.cpp | 3 +++ Source/player.cpp | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/debug.cpp b/Source/debug.cpp index 4dbae2b53dc..8f28bb4d963 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -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]; diff --git a/Source/player.cpp b/Source/player.cpp index bd246a0098a..b3026db622a 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -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];