Skip to content

Commit

Permalink
[playbot] Fix some stylistic logic display. pt3
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1arm committed Aug 21, 2024
1 parent 484a589 commit d91e788
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 269 deletions.
33 changes: 16 additions & 17 deletions src/modules/Bots/ahbot/Category.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,24 +300,23 @@ namespace ahbot
}
};


class QualityCategoryWrapper : public Category
{
public:
QualityCategoryWrapper(Category* category, uint32 quality);

public:
virtual bool Contains(ItemPrototype const* proto);
virtual uint32 GetMaxAllowedAuctionCount();
virtual string GetName() { return category->GetName(); }
virtual string GetDisplayName() { return combinedName; }
virtual uint32 GetMaxAllowedItemAuctionCount(ItemPrototype const* proto);
virtual uint32 GetStackCount(ItemPrototype const* proto) { return category->GetStackCount(proto); }
virtual PricingStrategy* GetPricingStrategy() { return category->GetPricingStrategy(); }

private:
uint32 quality;
Category* category;
string combinedName;
public:
QualityCategoryWrapper(Category* category, uint32 quality);

public:
virtual bool Contains(ItemPrototype const* proto);
virtual uint32 GetMaxAllowedAuctionCount();
virtual string GetName() { return category->GetName(); }
virtual string GetDisplayName() { return combinedName; }
virtual uint32 GetMaxAllowedItemAuctionCount(ItemPrototype const* proto);
virtual uint32 GetStackCount(ItemPrototype const* proto) { return category->GetStackCount(proto); }
virtual PricingStrategy* GetPricingStrategy() { return category->GetPricingStrategy(); }

private:
uint32 quality;
Category* category;
string combinedName;
};
};
2 changes: 2 additions & 0 deletions src/modules/Bots/playerbot/ChatHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ string ChatHelper::formatMoney(uint32 copper)
{
out << gold << "|TInterface\\AddOns\\AtlasLoot\\Images\\gold:0|t ";
}

if (silver > 0 && gold < 50)
{
out << silver << "|TInterface\\AddOns\\AtlasLoot\\Images\\silver:0|t ";
}

if (copper > 0 && gold < 10)
{
out << copper << "|TInterface\\AddOns\\AtlasLoot\\Images\\bronze:0|t";
Expand Down
1 change: 0 additions & 1 deletion src/modules/Bots/playerbot/Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ uint64 extractGuid(WorldPacket& packet)
}
return guid;
}

8 changes: 4 additions & 4 deletions src/modules/Bots/playerbot/PlayerbotAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ bool PlayerbotAI::CanCastSpell(uint32 spellid, Unit* target, bool checkHasSpell)

ObjectGuid oldSel = bot->GetSelectionGuid();
bot->SetSelectionGuid(target->GetObjectGuid());
Spell *spell = new Spell(bot, spellInfo, false );
Spell *spell = new Spell(bot, spellInfo, false);

spell->m_targets.setUnitTarget(target);
spell->m_CastItem = aiObjectContext->GetValue<Item*>("item for spell", spellid)->Get();
Expand Down Expand Up @@ -1038,8 +1038,8 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target)
return false;
}

bot->clearUnitState( UNIT_STAT_CHASE );
bot->clearUnitState( UNIT_STAT_FOLLOW );
bot->clearUnitState(UNIT_STAT_CHASE);
bot->clearUnitState(UNIT_STAT_FOLLOW);

ObjectGuid oldSel = bot->GetSelectionGuid();
bot->SetSelectionGuid(target->GetObjectGuid());
Expand Down Expand Up @@ -1184,7 +1184,7 @@ bool PlayerbotAI::IsInterruptableSpellCasting(Unit* target, string spell)
return false;
}

SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid );
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid);
if (!spellInfo)
{
return false;
Expand Down
Loading

0 comments on commit d91e788

Please sign in to comment.