mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Prefer to pass CGameState as reference instead of pointer
This commit is contained in:
@ -122,10 +122,10 @@ void CGObjectInstance::setType(MapObjectID newID, MapObjectSubID newSubID)
|
||||
{
|
||||
auto position = visitablePos();
|
||||
auto oldOffset = getVisitableOffset();
|
||||
auto &tile = cb->gameState()->getMap().getTile(position);
|
||||
auto &tile = cb->gameState().getMap().getTile(position);
|
||||
|
||||
//recalculate blockvis tiles - new appearance might have different blockmap than before
|
||||
cb->gameState()->getMap().hideObject(this);
|
||||
cb->gameState().getMap().hideObject(this);
|
||||
auto handler = LIBRARY->objtypeh->getHandlerFor(newID, newSubID);
|
||||
|
||||
if(!handler->getTemplates(tile.getTerrainID()).empty())
|
||||
@ -155,7 +155,7 @@ void CGObjectInstance::setType(MapObjectID newID, MapObjectSubID newSubID)
|
||||
this->ID = Obj(newID);
|
||||
this->subID = newSubID;
|
||||
|
||||
cb->gameState()->getMap().showObject(this);
|
||||
cb->gameState().getMap().showObject(this);
|
||||
}
|
||||
|
||||
void CGObjectInstance::pickRandomObject(vstd::RNG & rand)
|
||||
|
Reference in New Issue
Block a user