feat(Core/Config): Infinite ammo config setting (#22969)

Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
Degen
2025-09-23 21:46:04 -03:00
committed by GitHub
parent ae5001d16e
commit d05213d85e
4 changed files with 14 additions and 3 deletions

View File

@@ -5422,15 +5422,16 @@ void Spell::TakeAmmo()
// decrease durability for non-stackable throw weapon
m_caster->ToPlayer()->DurabilityPointLossForEquipSlot(EQUIPMENT_SLOT_RANGED);
}
else
else if (!sWorld->getBoolConfig(CONFIG_ENABLE_INFINITEAMMO))
{
// decrease items amount for stackable throw weapon
uint32 count = 1;
m_caster->ToPlayer()->DestroyItemCount(pItem, count, true);
}
}
else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID))
m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true);
else if (!sWorld->getBoolConfig(CONFIG_ENABLE_INFINITEAMMO))
if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID))
m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true);
}
}