From ec15c7f4c31a4879543d3a3d8e0d0893556965ec Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 4 Feb 2017 16:29:01 +0100 Subject: [PATCH] - removed the fatal errors for invalid actor->movedir. These can be silently mapped to DI_NODIR to let the engine get the actor back on track. --- src/b_move.cpp | 8 ++++---- src/p_enemy.cpp | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/b_move.cpp b/src/b_move.cpp index b31e4acbe..2a3d40bcb 100644 --- a/src/b_move.cpp +++ b/src/b_move.cpp @@ -65,11 +65,11 @@ bool DBot::Move (ticcmd_t *cmd) bool try_ok; int good; - if (player->mo->movedir == DI_NODIR) + if (player->mo->movedir >= DI_NODIR) + { + player->mo->movedir = DI_NODIR; // make sure it's valid. return false; - - if ((unsigned)player->mo->movedir >= 8) - I_Error ("Weird bot movedir!"); + } tryx = player->mo->X() + 8*xspeed[player->mo->movedir]; tryy = player->mo->Y() + 8*yspeed[player->mo->movedir]; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 2926e4e8c..bd5a9cb17 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -570,8 +570,9 @@ bool P_Move (AActor *actor) return true; } - if (actor->movedir == DI_NODIR) + if (actor->movedir >= DI_NODIR) { + actor->movedir = DI_NODIR; // make sure it's valid. return false; } @@ -585,9 +586,6 @@ bool P_Move (AActor *actor) return false; } - if ((unsigned)actor->movedir >= 8) - I_Error ("Weird actor->movedir!"); - // killough 10/98: allow dogs to drop off of taller ledges sometimes. // dropoff==1 means always allow it, dropoff==2 means only up to 128 high, // and only if the target is immediately on the other side of the line.