mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
Removed pointer to VLC entity from CStackBasicDescriptor
This commit is contained in:
@ -373,7 +373,7 @@ void CGarrisonSlot::gesture(bool on, const Point & initialPosition, const Point
|
||||
const auto * otherArmy = upg == EGarrisonType::UPPER ? owner->lowerArmy() : owner->upperArmy();
|
||||
|
||||
bool stackExists = myStack != nullptr;
|
||||
bool hasSameUnit = stackExists && !owner->army(upg)->getCreatureSlots(myStack->type, ID).empty();
|
||||
bool hasSameUnit = stackExists && !owner->army(upg)->getCreatureSlots(myStack->getCreature(), ID).empty();
|
||||
bool hasOwnEmptySlots = stackExists && owner->army(upg)->getFreeSlot() != SlotID();
|
||||
bool exchangeMode = stackExists && owner->upperArmy() && owner->lowerArmy();
|
||||
bool hasOtherEmptySlots = exchangeMode && otherArmy->getFreeSlot() != SlotID();
|
||||
@ -398,7 +398,7 @@ void CGarrisonSlot::update()
|
||||
{
|
||||
addUsedEvents(LCLICK | SHOW_POPUP | GESTURE | HOVER);
|
||||
myStack = getObj()->getStackPtr(ID);
|
||||
creature = myStack ? myStack->type : nullptr;
|
||||
creature = myStack ? myStack->getCreature() : nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -426,7 +426,7 @@ CGarrisonSlot::CGarrisonSlot(CGarrisonInt * Owner, int x, int y, SlotID IID, EGa
|
||||
: ID(IID),
|
||||
owner(Owner),
|
||||
myStack(creature_),
|
||||
creature(creature_ ? creature_->type : nullptr),
|
||||
creature(creature_ ? creature_->getCreature() : nullptr),
|
||||
upg(Upg)
|
||||
{
|
||||
OBJECT_CONSTRUCTION;
|
||||
|
@ -280,7 +280,7 @@ void CArmyTooltip::init(const InfoAboutArmy &army)
|
||||
continue;
|
||||
}
|
||||
|
||||
icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), slot.second.type->getIconIndex(), 0, slotsPos[slot.first.getNum()].x, slotsPos[slot.first.getNum()].y));
|
||||
icons.push_back(std::make_shared<CAnimImage>(AnimationPath::builtin("CPRSMALL"), slot.second.getType()->getIconIndex(), 0, slotsPos[slot.first.getNum()].x, slotsPos[slot.first.getNum()].y));
|
||||
|
||||
std::string subtitle;
|
||||
if(army.army.isDetailed)
|
||||
|
Reference in New Issue
Block a user