mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
- Moved gameState::guardingCreaturePosition() to CMap so it doesn't need to be recalculated many times for every player.
- Some optimizations with local cb pinter in VCAI.
This commit is contained in:
@ -380,6 +380,7 @@ DLL_LINKAGE void RemoveObject::applyGs( CGameState *gs )
|
||||
}
|
||||
|
||||
gs->map->objects[id.getNum()].dellNull();
|
||||
gs->map->calculateGuardingGreaturePositions();
|
||||
}
|
||||
|
||||
static int getDir(int3 src, int3 dst)
|
||||
@ -613,6 +614,7 @@ DLL_LINKAGE void NewObject::applyGs( CGameState *gs )
|
||||
gs->map->objects.push_back(o);
|
||||
gs->map->addBlockVisTiles(o);
|
||||
o->initObj();
|
||||
gs->map->calculateGuardingGreaturePositions();
|
||||
|
||||
logGlobal->debugStream() << "added object id=" << id << "; address=" << (intptr_t)o << "; name=" << o->getHoverText();
|
||||
}
|
||||
|
Reference in New Issue
Block a user