1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Simplify blukMoveArmy logic, fix army transfer bugs

This commit is contained in:
Ivan Savenko
2025-08-01 18:21:02 +03:00
parent f773b87cd5
commit bc96515cec
4 changed files with 53 additions and 83 deletions

View File

@@ -173,20 +173,6 @@ std::vector<SlotID> CCreatureSet::getFreeSlots(ui32 slotsAmount) const
return freeSlots;
}
std::queue<SlotID> CCreatureSet::getFreeSlotsQueue(ui32 slotsAmount) const
{
std::queue<SlotID> freeSlots;
for(ui32 i = 0; i < slotsAmount; i++)
{
auto slot = SlotID(i);
if(!vstd::contains(stacks, slot))
freeSlots.push(slot);
}
return freeSlots;
}
TMapCreatureSlot CCreatureSet::getCreatureMap() const
{
TMapCreatureSlot creatureMap;

View File

@@ -117,7 +117,6 @@ public:
SlotID getFreeSlot(ui32 slotsAmount = GameConstants::ARMY_SIZE) const; //returns first free slot
std::vector<SlotID> getFreeSlots(ui32 slotsAmount = GameConstants::ARMY_SIZE) const;
std::queue<SlotID> getFreeSlotsQueue(ui32 slotsAmount = GameConstants::ARMY_SIZE) const;
TMapCreatureSlot getCreatureMap() const;
TCreatureQueue getCreatureQueue(const SlotID & exclude) const;