- 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.
This commit is contained in:
Christoph Oelckers 2017-02-04 16:29:01 +01:00
parent 43d759782d
commit ec15c7f4c3
2 changed files with 6 additions and 8 deletions

View File

@ -65,11 +65,11 @@ bool DBot::Move (ticcmd_t *cmd)
bool try_ok; bool try_ok;
int good; 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; return false;
}
if ((unsigned)player->mo->movedir >= 8)
I_Error ("Weird bot movedir!");
tryx = player->mo->X() + 8*xspeed[player->mo->movedir]; tryx = player->mo->X() + 8*xspeed[player->mo->movedir];
tryy = player->mo->Y() + 8*yspeed[player->mo->movedir]; tryy = player->mo->Y() + 8*yspeed[player->mo->movedir];

View File

@ -570,8 +570,9 @@ bool P_Move (AActor *actor)
return true; return true;
} }
if (actor->movedir == DI_NODIR) if (actor->movedir >= DI_NODIR)
{ {
actor->movedir = DI_NODIR; // make sure it's valid.
return false; return false;
} }
@ -585,9 +586,6 @@ bool P_Move (AActor *actor)
return false; return false;
} }
if ((unsigned)actor->movedir >= 8)
I_Error ("Weird actor->movedir!");
// killough 10/98: allow dogs to drop off of taller ledges sometimes. // 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, // 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. // and only if the target is immediately on the other side of the line.