diff --git a/CCallback.cpp b/CCallback.cpp index 8009bc7db..da280db1c 100644 --- a/CCallback.cpp +++ b/CCallback.cpp @@ -80,7 +80,7 @@ void CCallback::recruitCreatures(const CGDwelling *obj, const CArmedInstance * d bool CCallback::dismissCreature(const CArmedInstance *obj, SlotID stackPos) { - if(((player>=0) && obj->tempOwner != player) || (obj->stacksCount()<2 && obj->needsLastStack())) + if((player && obj->tempOwner != player) || (obj->stacksCount()<2 && obj->needsLastStack())) return false; DisbandCreature pack(stackPos,obj->id); diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index 2d9dd0172..0026a6672 100644 --- a/lib/CArtHandler.cpp +++ b/lib/CArtHandler.cpp @@ -671,7 +671,7 @@ boost::optional&> CArtHandler::listFromClass( CArtifact: case CArtifact::ART_RELIC: return relics; default: //special artifacts should not be erased - return nullptr; + return boost::optional&>(); } } diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp index 051bb9cb9..2a59b96d3 100644 --- a/lib/CGameInfoCallback.cpp +++ b/lib/CGameInfoCallback.cpp @@ -403,7 +403,7 @@ std::vector CGameInfoCallback::getVisitableObjs(int3 for(const CGObjectInstance * obj : t->visitableObjects) { - if(player < nullptr || obj->ID != Obj::EVENT) //hide events from players + if(player || obj->ID != Obj::EVENT) //hide events from players ret.push_back(obj); }