diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 912cdaa01..1296ae3c1 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -8790,7 +8790,7 @@ scriptwait: break; case PCD_PLAYERINGAME: - if (STACK(1) < 0 || STACK(1) > MAXPLAYERS) + if (STACK(1) < 0 || STACK(1) >= MAXPLAYERS) { STACK(1) = false; } @@ -8801,7 +8801,7 @@ scriptwait: break; case PCD_PLAYERISBOT: - if (STACK(1) < 0 || STACK(1) > MAXPLAYERS || !playeringame[STACK(1)]) + if (STACK(1) < 0 || STACK(1) >= MAXPLAYERS || !playeringame[STACK(1)]) { STACK(1) = false; }