From 682707e4f143b6360dd882eb53c8ade82006bc4a Mon Sep 17 00:00:00 2001 From: Andrii Danylchenko Date: Sat, 15 May 2021 22:04:53 +0300 Subject: [PATCH] Nullkiller: fix build and warnings --- AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp | 7 +++++-- AI/Nullkiller/Engine/Nullkiller.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp b/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp index 3fbe23ac6..f1fe33758 100644 --- a/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp +++ b/AI/Nullkiller/Behaviors/CaptureObjectsBehavior.cpp @@ -131,12 +131,15 @@ bool CaptureObjectsBehavior::shouldVisitObject(ObjectIdRef obj) const { const CGObjectInstance* objInstance = obj; - if(!objInstance || objectTypes.size() && !vstd::contains(objectTypes, objInstance->ID.num)) + if(!objInstance) + return false; + + if(objectTypes.size() && !vstd::contains(objectTypes, objInstance->ID.num)) { return false; } - if(!objInstance || objectSubTypes.size() && !vstd::contains(objectSubTypes, objInstance->subID)) + if(objectSubTypes.size() && !vstd::contains(objectSubTypes, objInstance->subID)) { return false; } diff --git a/AI/Nullkiller/Engine/Nullkiller.cpp b/AI/Nullkiller/Engine/Nullkiller.cpp index 00e056ac4..9ad380d9a 100644 --- a/AI/Nullkiller/Engine/Nullkiller.cpp +++ b/AI/Nullkiller/Engine/Nullkiller.cpp @@ -10,7 +10,7 @@ #include "StdInc.h" #include "Nullkiller.h" #include "../VCAI.h" -#include "../AIHelper.h" +#include "../AIhelper.h" #include "../Behaviors/CaptureObjectsBehavior.h" #include "../Behaviors/RecruitHeroBehavior.h" #include "../Behaviors/BuyArmyBehavior.h"