瀏覽代碼

Update town visual when new structure is built

Ivan Savenko 2 年之前
父節點
當前提交
ef07935fbc
共有 1 個文件被更改,包括 10 次插入1 次删除
  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));
 	}