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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user