From ffe62da3c777adaa211261dbd510bdd4347e4003 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 25 Jul 2021 15:37:50 +1000 Subject: [PATCH] - Blood: Add some nullptr checks to the `aiPatrol*()` inline bools. --- source/games/blood/src/nnexts.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/games/blood/src/nnexts.h b/source/games/blood/src/nnexts.h index 6351c7bd0..2345749dc 100644 --- a/source/games/blood/src/nnexts.h +++ b/source/games/blood/src/nnexts.h @@ -435,19 +435,19 @@ inline int aiPatrolGetVelocity(int speed, int value) { } inline bool aiPatrolWaiting(AISTATE* pAiState) { - return (pAiState->stateType >= kAiStatePatrolWaitL && pAiState->stateType <= kAiStatePatrolWaitW); + return (pAiState && pAiState->stateType >= kAiStatePatrolWaitL && pAiState->stateType <= kAiStatePatrolWaitW); } inline bool aiPatrolMoving(AISTATE* pAiState) { - return (pAiState->stateType >= kAiStatePatrolMoveL && pAiState->stateType <= kAiStatePatrolMoveW); + return (pAiState && pAiState->stateType >= kAiStatePatrolMoveL && pAiState->stateType <= kAiStatePatrolMoveW); } inline bool aiPatrolTurning(AISTATE* pAiState) { - return (pAiState->stateType >= kAiStatePatrolTurnL && pAiState->stateType <= kAiStatePatrolTurnW); + return (pAiState && pAiState->stateType >= kAiStatePatrolTurnL && pAiState->stateType <= kAiStatePatrolTurnW); } inline bool aiInPatrolState(AISTATE* pAiState) { - return (pAiState->stateType >= kAiStatePatrolBase && pAiState->stateType < kAiStatePatrolMax); + return (pAiState && pAiState->stateType >= kAiStatePatrolBase && pAiState->stateType < kAiStatePatrolMax); } inline bool aiInPatrolState(int nAiStateType) {