fix: also use school mask for pre-cast melee range/facing check in castSpell()

Same DBC-driven physical school detection replaces the brittle hardcoded
warrior spell list in the pre-cast range check, so rogue, DK, paladin,
feral druid, and hunter melee abilities get correct range/facing enforcement.
This commit is contained in:
Kelsi 2026-03-11 02:40:27 -07:00
parent 21c55ad6b4
commit d696da9227

View file

@ -13536,22 +13536,16 @@ void GameHandler::castSpell(uint32_t spellId, uint64_t targetGuid) {
}
// Instant melee abilities: client-side range + facing check to avoid server "not in front" errors
// Detected via physical school mask (1) from DBC cache — covers warrior, rogue, DK, paladin,
// feral druid, and hunter melee abilities generically.
{
uint32_t sid = spellId;
bool isMeleeAbility =
sid == 78 || sid == 284 || sid == 285 || sid == 1608 || // Heroic Strike
sid == 11564 || sid == 11565 || sid == 11566 || sid == 11567 ||
sid == 25286 || sid == 29707 || sid == 30324 ||
sid == 772 || sid == 6546 || sid == 6547 || sid == 6548 || // Rend
sid == 11572 || sid == 11573 || sid == 11574 || sid == 25208 ||
sid == 6572 || sid == 6574 || sid == 7379 || sid == 11600 || // Revenge
sid == 11601 || sid == 25288 || sid == 25269 || sid == 30357 ||
sid == 845 || sid == 7369 || sid == 11608 || sid == 11609 || // Cleave
sid == 20569 || sid == 25231 || sid == 47519 || sid == 47520 ||
sid == 12294 || sid == 21551 || sid == 21552 || sid == 21553 || // Mortal Strike
sid == 25248 || sid == 30330 || sid == 47485 || sid == 47486 ||
sid == 23922 || sid == 23923 || sid == 23924 || sid == 23925 || // Shield Slam
sid == 25258 || sid == 30356 || sid == 47487 || sid == 47488;
loadSpellNameCache();
bool isMeleeAbility = false;
auto cacheIt = spellNameCache_.find(spellId);
if (cacheIt != spellNameCache_.end() && cacheIt->second.schoolMask == 1) {
// Physical school and no cast time (instant) — treat as melee ability
isMeleeAbility = true;
}
if (isMeleeAbility && target != 0) {
auto entity = entityManager.getEntity(target);
if (entity) {