1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-21 21:17:49 +02:00

Town: update appearance in applyGs to avoid desyncs. Fix issue 2464

Netpacks NewStructures and RazeStructures
This commit is contained in:
Arseniy Shestakov 2016-08-24 05:15:04 +03:00
parent 25a68c3ca1
commit 5a387cdaf1
2 changed files with 4 additions and 4 deletions

View File

@ -416,8 +416,6 @@ void NewStructures::applyCl( CClient *cl )
CGTownInstance *town = GS(cl)->getTown(tid);
for(const auto & id : bid)
{
town->updateAppearance();
if(vstd::contains(cl->playerint,town->tempOwner))
cl->playerint[town->tempOwner]->buildChanged(town,id,1);
}
@ -427,8 +425,6 @@ void RazeStructures::applyCl (CClient *cl)
CGTownInstance *town = GS(cl)->getTown(tid);
for(const auto & id : bid)
{
town->updateAppearance();
if(vstd::contains (cl->playerint,town->tempOwner))
cl->playerint[town->tempOwner]->buildChanged (town,id,2);
}

View File

@ -533,6 +533,8 @@ DLL_LINKAGE void NewStructures::applyGs( CGameState *gs )
{
assert(t->town->buildings.at(id) != nullptr);
t->builtBuildings.insert(id);
t->updateAppearance();
}
t->builded = builded;
t->recreateBuildingsBonuses();
@ -543,6 +545,8 @@ DLL_LINKAGE void RazeStructures::applyGs( CGameState *gs )
for(const auto & id : bid)
{
t->builtBuildings.erase(id);
t->updateAppearance();
}
t->destroyed = destroyed; //yeaha
t->recreateBuildingsBonuses();