Dydzio il y a 7 ans
Parent
commit
f91c85a900
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      AI/VCAI/VCAI.cpp

+ 2 - 1
AI/VCAI/VCAI.cpp

@@ -1473,7 +1473,8 @@ void VCAI::wander(HeroPtr h)
 			if(bestObjectGoal->goalType == Goals::GET_OBJ)
 			if(bestObjectGoal->goalType == Goals::GET_OBJ)
 			{
 			{
 				auto chosenObject = cb->getObjInstance(ObjectInstanceID(bestObjectGoal->objid));
 				auto chosenObject = cb->getObjInstance(ObjectInstanceID(bestObjectGoal->objid));
-				logAi->debug("Of all %d destinations, object %s at pos=%s seems nice", dests.size(), chosenObject->getObjectName(), chosenObject->pos.toString());
+				if(chosenObject != nullptr)
+					logAi->debug("Of all %d destinations, object %s at pos=%s seems nice", dests.size(), chosenObject->getObjectName(), chosenObject->pos.toString());
 			}
 			}
 			else
 			else
 				logAi->debug("Trying to realize goal of type %d as part of wandering.", bestObjectGoal->goalType);
 				logAi->debug("Trying to realize goal of type %d as part of wandering.", bestObjectGoal->goalType);