mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Reduce non-const access to gamestate on server
This commit is contained in:
@@ -567,7 +567,7 @@ std::vector<SetMana> NewTurnProcessor::updateHeroesManaPoints()
|
||||
|
||||
for (auto & elem : gameHandler->gameState().players)
|
||||
{
|
||||
for (CGHeroInstance *h : elem.second.getHeroes())
|
||||
for (const CGHeroInstance *h : elem.second.getHeroes())
|
||||
{
|
||||
int32_t newMana = h->getManaNewTurn();
|
||||
|
||||
@@ -584,7 +584,7 @@ std::vector<SetMovePoints> NewTurnProcessor::updateHeroesMovementPoints()
|
||||
|
||||
for (auto & elem : gameHandler->gameState().players)
|
||||
{
|
||||
for (CGHeroInstance *h : elem.second.getHeroes())
|
||||
for (const CGHeroInstance *h : elem.second.getHeroes())
|
||||
{
|
||||
auto ti = h->getTurnInfo(1);
|
||||
// NOTE: this code executed when bonuses of previous day not yet updated (this happen in NewTurn::applyGs). See issue 2356
|
||||
|
||||
Reference in New Issue
Block a user