mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Large rewrite of adventure map objects:
- replaced CDefObjInfo with ObjectTemplate class - ObjectTempate is a direct member of objects instead of pointer with shared ownership across CMap, handler and game objects - simplified handling of objects that can change appearance (e.g. towns) - all object queries regarding object appearance/blockmaps use h3m pos instead of relative positions - removed need of modhandler::reload - cleanup of some old code
This commit is contained in:
@@ -410,14 +410,8 @@ void NewStructures::applyCl( CClient *cl )
|
||||
CGTownInstance *town = GS(cl)->getTown(tid);
|
||||
for(const auto & id : bid)
|
||||
{
|
||||
if(id == BuildingID::CAPITOL) //fort or capitol
|
||||
{
|
||||
town->defInfo = const_cast<CGDefInfo*>(CGI->dobjinfo->capitols.at(town->subID).get());
|
||||
}
|
||||
if(id == BuildingID::FORT)
|
||||
{
|
||||
town->defInfo = const_cast<CGDefInfo*>(CGI->dobjinfo->gobjs.at(Obj::TOWN).at(town->subID).get());
|
||||
}
|
||||
town->updateAppearance();
|
||||
|
||||
if(vstd::contains(cl->playerint,town->tempOwner))
|
||||
cl->playerint[town->tempOwner]->buildChanged(town,id,1);
|
||||
}
|
||||
@@ -427,10 +421,8 @@ void RazeStructures::applyCl (CClient *cl)
|
||||
CGTownInstance *town = GS(cl)->getTown(tid);
|
||||
for(const auto & id : bid)
|
||||
{
|
||||
if (id == BuildingID::CAPITOL) //fort or capitol
|
||||
{
|
||||
town->defInfo = const_cast<CGDefInfo*>(CGI->dobjinfo->gobjs.at(Obj::TOWN).at(town->subID).get());
|
||||
}
|
||||
town->updateAppearance();
|
||||
|
||||
if(vstd::contains (cl->playerint,town->tempOwner))
|
||||
cl->playerint[town->tempOwner]->buildChanged (town,id,2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user