mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Fix trainer buy packet and grey out unmet prerequisites
CMSG_TRAINER_BUY_SPELL was missing the trainerId field — server expects guid(8) + trainerId(4) + spellId(4) = 16 bytes, not 12. Spells with unmet prerequisites (chainNode1/2/3), insufficient level, or already known are now greyed out with disabled Train buttons. Tooltips show prerequisite status in green/red.
This commit is contained in:
parent
ee155c3367
commit
eb92a71b71
4 changed files with 39 additions and 13 deletions
|
|
@ -4582,7 +4582,10 @@ void GameHandler::handleTrainerList(network::Packet& packet) {
|
|||
|
||||
void GameHandler::trainSpell(uint32_t spellId) {
|
||||
if (state != WorldState::IN_WORLD || !socket) return;
|
||||
auto packet = TrainerBuySpellPacket::build(currentTrainerList_.trainerGuid, spellId);
|
||||
auto packet = TrainerBuySpellPacket::build(
|
||||
currentTrainerList_.trainerGuid,
|
||||
currentTrainerList_.trainerType,
|
||||
spellId);
|
||||
socket->send(packet);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2682,9 +2682,10 @@ bool TrainerListParser::parse(network::Packet& packet, TrainerListData& data) {
|
|||
return true;
|
||||
}
|
||||
|
||||
network::Packet TrainerBuySpellPacket::build(uint64_t trainerGuid, uint32_t spellId) {
|
||||
network::Packet TrainerBuySpellPacket::build(uint64_t trainerGuid, uint32_t trainerId, uint32_t spellId) {
|
||||
network::Packet packet(static_cast<uint16_t>(Opcode::CMSG_TRAINER_BUY_SPELL));
|
||||
packet.writeUInt64(trainerGuid);
|
||||
packet.writeUInt32(trainerId);
|
||||
packet.writeUInt32(spellId);
|
||||
return packet;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue