fix: warmup checks WMO floor proximity, not just terrain existence

Stormwind players stand on WMO floors ~95m above terrain. The previous
check only tested if terrain existed at the spawn XY (it did — far below).
Now checks WMO floor first, then terrain, requiring the ground to be within
15 units of spawn Z. Falls back to tile count after 10s.

Also adds diagnostic logging for useItemBySlot (hearthstone debug).
This commit is contained in:
Kelsi 2026-03-28 11:34:07 -07:00
parent 8aaa2e7ff3
commit 5a8ab87a78
2 changed files with 23 additions and 11 deletions

View file

@ -1086,12 +1086,17 @@ void InventoryHandler::useItemBySlot(int backpackIndex) {
break;
}
}
LOG_WARNING("useItemBySlot: item='", slot.item.name, "' entry=", slot.item.itemId,
" guid=0x", std::hex, itemGuid, std::dec,
" spellId=", useSpellId, " spellCount=", info->spells.size());
}
auto packet = owner_.packetParsers_
? owner_.packetParsers_->buildUseItem(0xFF, static_cast<uint8_t>(23 + backpackIndex), itemGuid, useSpellId)
: UseItemPacket::build(0xFF, static_cast<uint8_t>(23 + backpackIndex), itemGuid, useSpellId);
owner_.socket->send(packet);
} else if (itemGuid == 0) {
LOG_WARNING("useItemBySlot: itemGuid=0 for item='", slot.item.name,
"' entry=", slot.item.itemId, " — cannot use");
owner_.addSystemChatMessage("Cannot use that item right now.");
}
}