diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ed78d39b6d..78d59ec1a4 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10230,8 +10230,8 @@ bool Player::SetAmmo(uint32 itemId) void Player::AutoSelectAmmo() { - // A bot has no client to choose its ammo: it takes a stack that is drawn with a model, not the generic white-box display. - bool const preferDrawable = GetSession() && GetSession()->IsBot(); + // Without a client to choose its ammo, a player takes a stack that is drawn with a model, not the generic white-box display. + bool const preferDrawable = m_preferDrawableAmmo; if (uint32 current = GetAmmoId()) if (HasItemCount(current) && IsAmmoUsableWithRangedWeapon(sObjectMgr->GetItemTemplate(current)) && (!preferDrawable || HasDrawableAmmoDisplay(sObjectMgr->GetItemTemplate(current)))) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d4e64b2d55..d87f3ab80e 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1500,6 +1500,8 @@ class TC_GAME_API Player final : public Unit, public GridObject // has no model: the client draws a white box for it, nocked and in flight. static uint32 GetAmmoDisplayId(ItemTemplate const* proto); static bool HasDrawableAmmoDisplay(ItemTemplate const* proto) { uint32 const id = GetAmmoDisplayId(proto); return id && id < 500000; } + // A player without a client to choose its ammo (a bot) sets this: AutoSelectAmmo then takes a stack that is drawn with a model. + void SetPreferDrawableAmmo(bool on) { m_preferDrawableAmmo = on; } bool NeedsAmmo() const; // bow, gun or crossbow equipped Item* GetShield(bool useable = false) const; Item* GetChildItemByGuid(ObjectGuid guid) const; @@ -3312,6 +3314,7 @@ class TC_GAME_API Player final : public Unit, public GridObject bool m_itemUpdateQueueBlocked; uint32 m_ExtraFlags; + bool m_preferDrawableAmmo = false; QuestStatusMap m_QuestStatus; QuestObjectiveStatusMap m_questObjectiveStatus;