mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
fix test & fix build & suggested changes
This commit is contained in:
parent
c2f658d638
commit
7e6ab5e87b
@ -693,7 +693,7 @@ void CArtHandler::makeItCommanderArt(CArtifact * a, bool onlyCommander)
|
|||||||
a->possibleSlots[ArtBearer::HERO].clear();
|
a->possibleSlots[ArtBearer::HERO].clear();
|
||||||
a->possibleSlots[ArtBearer::CREATURE].clear();
|
a->possibleSlots[ArtBearer::CREATURE].clear();
|
||||||
}
|
}
|
||||||
for(auto & slot : ArtifactUtils::commanderSlots())
|
for(const auto & slot : ArtifactUtils::commanderSlots())
|
||||||
a->possibleSlots[ArtBearer::COMMANDER].push_back(ArtifactPosition(slot));
|
a->possibleSlots[ArtBearer::COMMANDER].push_back(ArtifactPosition(slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1080,7 +1080,7 @@ void CArtifactSet::serializeJsonArtifacts(JsonSerializeFormat & handler, const s
|
|||||||
|
|
||||||
void CArtifactSet::serializeJsonHero(JsonSerializeFormat & handler, CMap * map)
|
void CArtifactSet::serializeJsonHero(JsonSerializeFormat & handler, CMap * map)
|
||||||
{
|
{
|
||||||
for(auto & slot : ArtifactUtils::allWornSlots())
|
for(const auto & slot : ArtifactUtils::allWornSlots())
|
||||||
{
|
{
|
||||||
serializeJsonSlot(handler, slot, map);
|
serializeJsonSlot(handler, slot, map);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "gameState/TavernHeroesPool.h"
|
#include "gameState/TavernHeroesPool.h"
|
||||||
#include "gameState/QuestInfo.h"
|
#include "gameState/QuestInfo.h"
|
||||||
#include "mapObjects/CGHeroInstance.h"
|
#include "mapObjects/CGHeroInstance.h"
|
||||||
|
#include "networkPacks/ArtifactLocation.h"
|
||||||
#include "CGeneralTextHandler.h"
|
#include "CGeneralTextHandler.h"
|
||||||
#include "StartInfo.h" // for StartInfo
|
#include "StartInfo.h" // for StartInfo
|
||||||
#include "battle/BattleInfo.h" // for BattleInfo
|
#include "battle/BattleInfo.h" // for BattleInfo
|
||||||
|
@ -396,7 +396,7 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle)
|
|||||||
for (auto armySlot : battle.battleGetArmyObject(loser)->stacks)
|
for (auto armySlot : battle.battleGetArmyObject(loser)->stacks)
|
||||||
{
|
{
|
||||||
auto artifactsWorn = armySlot.second->artifactsWorn;
|
auto artifactsWorn = armySlot.second->artifactsWorn;
|
||||||
for(auto & artSlot : artifactsWorn)
|
for(const auto & artSlot : artifactsWorn)
|
||||||
{
|
{
|
||||||
MoveArtifact ma;
|
MoveArtifact ma;
|
||||||
ma.src = ArtifactLocation(finishingBattle->loserHero->id, artSlot.first);
|
ma.src = ArtifactLocation(finishingBattle->loserHero->id, artSlot.first);
|
||||||
|
@ -17,20 +17,6 @@
|
|||||||
#include "../../lib/networkPacks/PacksForServer.h"
|
#include "../../lib/networkPacks/PacksForServer.h"
|
||||||
#include "../../lib/serializer/Cast.h"
|
#include "../../lib/serializer/Cast.h"
|
||||||
|
|
||||||
struct GetEngagedHeroIds
|
|
||||||
{
|
|
||||||
std::optional<ObjectInstanceID> operator()(const ConstTransitivePtr<CGHeroInstance> & h) const
|
|
||||||
{
|
|
||||||
return h->id;
|
|
||||||
}
|
|
||||||
std::optional<ObjectInstanceID> operator()(const ConstTransitivePtr<CStackInstance> & s) const
|
|
||||||
{
|
|
||||||
if(s->armyObj && s->armyObj->ID == Obj::HERO)
|
|
||||||
return s->armyObj->id;
|
|
||||||
return std::optional<ObjectInstanceID>();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player):
|
TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player):
|
||||||
CQuery(owner)
|
CQuery(owner)
|
||||||
{
|
{
|
||||||
|
@ -240,7 +240,7 @@ TEST_F(CGameStateTest, issue2765)
|
|||||||
gameCallback->sendAndApply(&na);
|
gameCallback->sendAndApply(&na);
|
||||||
|
|
||||||
PutArtifact pack;
|
PutArtifact pack;
|
||||||
pack.al = ArtifactLocation(defender, ArtifactPosition::MACH1);
|
pack.al = ArtifactLocation(defender->id, ArtifactPosition::MACH1);
|
||||||
pack.art = a;
|
pack.art = a;
|
||||||
gameCallback->sendAndApply(&pack);
|
gameCallback->sendAndApply(&pack);
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ TEST_F(CGameStateTest, battleResurrection)
|
|||||||
gameCallback->sendAndApply(&na);
|
gameCallback->sendAndApply(&na);
|
||||||
|
|
||||||
PutArtifact pack;
|
PutArtifact pack;
|
||||||
pack.al = ArtifactLocation(attacker, ArtifactPosition::SPELLBOOK);
|
pack.al = ArtifactLocation(attacker->id, ArtifactPosition::SPELLBOOK);
|
||||||
pack.art = a;
|
pack.art = a;
|
||||||
gameCallback->sendAndApply(&pack);
|
gameCallback->sendAndApply(&pack);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user