Explorar o código

Update town visual when new structure is built

Ivan Savenko %!s(int64=2) %!d(string=hai) anos
pai
achega
ef07935fbc
Modificáronse 1 ficheiros con 10 adicións e 1 borrados
  1. 10 1
      client/NetPacksClient.cpp

+ 10 - 1
client/NetPacksClient.cpp

@@ -514,6 +514,11 @@ void ApplyClientNetPackVisitor::visitNewStructures(NewStructures & pack)
 	{
 		callInterfaceIfPresent(cl, town->tempOwner, &IGameEventsReceiver::buildChanged, town, id, 1);
 	}
+
+	// invalidate section of map view with our object and force an update
+	CGI->mh->onObjectInstantRemove(town);
+	CGI->mh->onObjectInstantAdd(town);
+
 }
 void ApplyClientNetPackVisitor::visitRazeStructures(RazeStructures & pack)
 {
@@ -522,6 +527,10 @@ void ApplyClientNetPackVisitor::visitRazeStructures(RazeStructures & pack)
 	{
 		callInterfaceIfPresent(cl, town->tempOwner, &IGameEventsReceiver::buildChanged, town, id, 2);
 	}
+
+	// invalidate section of map view with our object and force an update
+	CGI->mh->onObjectInstantRemove(town);
+	CGI->mh->onObjectInstantAdd(town);
 }
 
 void ApplyClientNetPackVisitor::visitSetAvailableCreatures(SetAvailableCreatures & pack)
@@ -607,7 +616,7 @@ void ApplyClientNetPackVisitor::visitSetObjectProperty(SetObjectProperty & pack)
 
 	if (pack.what == ObjProperty::OWNER)
 	{
-		// invalidate section of map view with our objec and force an update with new flag color
+		// invalidate section of map view with our object and force an update with new flag color
 		CGI->mh->onObjectInstantRemove(gs.getObjInstance(pack.id));
 		CGI->mh->onObjectInstantAdd(gs.getObjInstance(pack.id));
 	}