mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-19 00:17:56 +02:00
Merge pull request #5700 from IvanSavenko/gamestate_pack_visitor
Remove CPack::applyGs method in favor of GameStatePackVisitor class
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
#include "../callback/IGameCallback.h"
|
||||
#include "../networkPacks/PacksForClient.h"
|
||||
#include "../mapObjectConstructors/FlaggableInstanceConstructor.h"
|
||||
#include "../gameState/GameStatePackVisitor.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@ -88,7 +89,10 @@ void FlaggableMapObject::giveBonusTo(const PlayerColor & player, bool onInit) co
|
||||
// Proper fix would be to make FlaggableMapObject into bonus system node
|
||||
// Unfortunately this will cause saves breakage
|
||||
if(onInit)
|
||||
gb.applyGs(&cb->gameState());
|
||||
{
|
||||
GameStatePackVisitor visitor(cb->gameState());
|
||||
gb.visit(visitor);
|
||||
}
|
||||
else
|
||||
cb->sendAndApply(gb);
|
||||
}
|
||||
|
Reference in New Issue
Block a user