|
|
@@ -11,6 +11,7 @@
|
|
|
|
|
|
#include "NetPacksBase.h"
|
|
|
#include "BattleChanges.h"
|
|
|
+#include "PacksForClient.h"
|
|
|
#include "../battle/BattleHexArray.h"
|
|
|
#include "../battle/BattleAction.h"
|
|
|
#include "../texts/MetaString.h"
|
|
|
@@ -95,15 +96,13 @@ struct DLL_LINKAGE BattleResultAccepted : public CPackForClient
|
|
|
struct HeroBattleResults
|
|
|
{
|
|
|
HeroBattleResults()
|
|
|
- : hero(nullptr), army(nullptr), exp(0) {}
|
|
|
+ : army(ObjectInstanceID::NONE), exp(0) {}
|
|
|
|
|
|
- CGHeroInstance * hero;
|
|
|
- CArmedInstance * army;
|
|
|
+ ObjectInstanceID army;
|
|
|
TExpType exp;
|
|
|
|
|
|
template <typename Handler> void serialize(Handler & h)
|
|
|
{
|
|
|
- h & hero;
|
|
|
h & army;
|
|
|
h & exp;
|
|
|
}
|
|
|
@@ -112,12 +111,14 @@ struct DLL_LINKAGE BattleResultAccepted : public CPackForClient
|
|
|
BattleID battleID = BattleID::NONE;
|
|
|
BattleSideArray<HeroBattleResults> heroResult;
|
|
|
BattleSide winnerSide;
|
|
|
+ std::vector<BulkMoveArtifacts> artifacts;
|
|
|
|
|
|
template <typename Handler> void serialize(Handler & h)
|
|
|
{
|
|
|
h & battleID;
|
|
|
h & heroResult;
|
|
|
h & winnerSide;
|
|
|
+ h & artifacts;
|
|
|
assert(battleID != BattleID::NONE);
|
|
|
}
|
|
|
};
|
|
|
@@ -131,7 +132,6 @@ struct DLL_LINKAGE BattleResult : public Query
|
|
|
BattleSide winner = BattleSide::NONE; //0 - attacker, 1 - defender, [2 - draw (should be possible?)]
|
|
|
BattleSideArray<std::map<CreatureID, si32>> casualties; //first => casualties of attackers - map crid => number
|
|
|
BattleSideArray<TExpType> exp{0,0}; //exp for attacker and defender
|
|
|
- std::set<ArtifactInstanceID> artifacts; //artifacts taken from loser to winner - currently unused
|
|
|
|
|
|
void visitTyped(ICPackVisitor & visitor) override;
|
|
|
void applyGs(CGameState *gs) override {}
|
|
|
@@ -144,7 +144,6 @@ struct DLL_LINKAGE BattleResult : public Query
|
|
|
h & winner;
|
|
|
h & casualties;
|
|
|
h & exp;
|
|
|
- h & artifacts;
|
|
|
assert(battleID != BattleID::NONE);
|
|
|
}
|
|
|
};
|
|
|
@@ -421,15 +420,18 @@ struct DLL_LINKAGE StacksInjured : public CPackForClient
|
|
|
struct DLL_LINKAGE BattleResultsApplied : public CPackForClient
|
|
|
{
|
|
|
BattleID battleID = BattleID::NONE;
|
|
|
- PlayerColor player1, player2;
|
|
|
+ PlayerColor victor;
|
|
|
+ PlayerColor loser;
|
|
|
+ std::vector<BulkMoveArtifacts> artifacts;
|
|
|
void visitTyped(ICPackVisitor & visitor) override;
|
|
|
void applyGs(CGameState *gs) override {}
|
|
|
|
|
|
template <typename Handler> void serialize(Handler & h)
|
|
|
{
|
|
|
h & battleID;
|
|
|
- h & player1;
|
|
|
- h & player2;
|
|
|
+ h & victor;
|
|
|
+ h & loser;
|
|
|
+ h & artifacts;
|
|
|
assert(battleID != BattleID::NONE);
|
|
|
}
|
|
|
};
|