1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Rumors: avoid repeating of same rumor twice in a row

Multiple rumors of same type can go in a row, but not identical rumors.
This commit is contained in:
ArseniyShestakov
2015-12-01 02:14:11 +03:00
parent 98582d628c
commit 15273ac0f7
3 changed files with 62 additions and 44 deletions

View File

@@ -219,6 +219,7 @@ struct DLL_LINKAGE RumorState
std::map<ERumorType, std::pair<int, int>> last;
RumorState(){type = RUMOR_NONE; last = {};};
bool update(int id, int player);
template <typename Handler> void serialize(Handler &h, const int version)
{
@@ -371,7 +372,7 @@ public:
{
h & rumor;
}
else
else if(!h.saving)
rumor = RumorState();
BONUS_TREE_DESERIALIZATION_FIX