Преглед изворни кода

Fix possible crash on actions with no initiator set

Such as spawning of new wandering monsters on new month
Ivan Savenko пре 1 година
родитељ
комит
c7dd0c6523
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      client/mapView/MapViewController.cpp

+ 2 - 2
client/mapView/MapViewController.cpp

@@ -298,7 +298,7 @@ bool MapViewController::isEventVisible(const CGObjectInstance * obj, const Playe
 		return false;
 		return false;
 
 
 	// do not focus on actions of other players except for AI with simturns off
 	// do not focus on actions of other players except for AI with simturns off
-	if (initiator != LOCPLINT->playerID)
+	if (initiator != LOCPLINT->playerID && initiator.isValidPlayer())
 	{
 	{
 		if (LOCPLINT->makingTurn)
 		if (LOCPLINT->makingTurn)
 			return false;
 			return false;
@@ -324,7 +324,7 @@ bool MapViewController::isEventVisible(const CGHeroInstance * obj, const int3 &
 		return false;
 		return false;
 
 
 	// do not focus on actions of other players except for AI with simturns off
 	// do not focus on actions of other players except for AI with simturns off
-	if (obj->getOwner() != LOCPLINT->playerID)
+	if (obj->getOwner() != LOCPLINT->playerID && obj->getOwner().isValidPlayer())
 	{
 	{
 		if (LOCPLINT->makingTurn)
 		if (LOCPLINT->makingTurn)
 			return false;
 			return false;