mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Players affected by event is now stored as std::set instead of bitmask
This commit is contained in:
@@ -36,7 +36,7 @@ public:
|
||||
std::string name;
|
||||
MetaString message;
|
||||
TResources resources;
|
||||
ui8 players; // affected players, bit field?
|
||||
std::set<PlayerColor> players;
|
||||
bool humanAffected;
|
||||
bool computerAffected;
|
||||
ui32 firstOccurrence;
|
||||
@@ -48,7 +48,18 @@ public:
|
||||
h & name;
|
||||
h & message;
|
||||
h & resources;
|
||||
h & players;
|
||||
if (h.version >= Handler::Version::EVENTS_PLAYER_SET)
|
||||
{
|
||||
h & players;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui8 playersMask = 0;
|
||||
h & playersMask;
|
||||
for (int i = 0; i < 8; ++i)
|
||||
if ((playersMask & (1 << i)) != 0)
|
||||
players.insert(PlayerColor(i));
|
||||
}
|
||||
h & humanAffected;
|
||||
h & computerAffected;
|
||||
h & firstOccurrence;
|
||||
|
||||
Reference in New Issue
Block a user