1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Prefer to pass CGameState as reference instead of pointer

This commit is contained in:
Ivan Savenko
2025-04-19 14:14:12 +03:00
parent ce436bd63e
commit 4d57a8ed36
67 changed files with 465 additions and 466 deletions

View File

@ -108,7 +108,7 @@ void CGResource::collectRes(const PlayerColor & player) const
sii.text.replaceName(resourceID());
}
sii.components.emplace_back(ComponentType::RESOURCE, resourceID(), amount);
sii.soundID = soundBase::pickup01 + cb->gameState()->getRandomGenerator().nextInt(6);
sii.soundID = soundBase::pickup01 + cb->gameState().getRandomGenerator().nextInt(6);
cb->showInfoDialog(&sii);
cb->removeObject(this, player);
}