1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

Nullkiller: fix build and warnings

This commit is contained in:
Andrii Danylchenko
2021-05-15 22:04:53 +03:00
committed by Andrii Danylchenko
parent fdd5be1e40
commit 682707e4f1
2 changed files with 6 additions and 3 deletions

View File

@ -131,12 +131,15 @@ bool CaptureObjectsBehavior::shouldVisitObject(ObjectIdRef obj) const
{ {
const CGObjectInstance* objInstance = obj; 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; return false;
} }
if(!objInstance || objectSubTypes.size() && !vstd::contains(objectSubTypes, objInstance->subID)) if(objectSubTypes.size() && !vstd::contains(objectSubTypes, objInstance->subID))
{ {
return false; return false;
} }

View File

@ -10,7 +10,7 @@
#include "StdInc.h" #include "StdInc.h"
#include "Nullkiller.h" #include "Nullkiller.h"
#include "../VCAI.h" #include "../VCAI.h"
#include "../AIHelper.h" #include "../AIhelper.h"
#include "../Behaviors/CaptureObjectsBehavior.h" #include "../Behaviors/CaptureObjectsBehavior.h"
#include "../Behaviors/RecruitHeroBehavior.h" #include "../Behaviors/RecruitHeroBehavior.h"
#include "../Behaviors/BuyArmyBehavior.h" #include "../Behaviors/BuyArmyBehavior.h"