Add mount system and crash mouse-release handler

Render mount M2 model under player with seated animation, apply creature
skin textures, server-driven speed via SMSG_FORCE_RUN_SPEED_CHANGE, and
/dismount command. X11 XUngrabPointer on crash/hang to always release mouse.
This commit is contained in:
Kelsi 2026-02-07 17:59:40 -08:00
parent 4e749080ec
commit 6ba143ddc0
13 changed files with 363 additions and 3 deletions

View file

@ -455,6 +455,13 @@ public:
}
const std::unordered_map<uint64_t, QuestGiverStatus>& getNpcQuestStatuses() const { return npcQuestStatus_; }
// Mount state
using MountCallback = std::function<void(uint32_t mountDisplayId)>; // 0 = dismount
void setMountCallback(MountCallback cb) { mountCallback_ = std::move(cb); }
bool isMounted() const { return currentMountDisplayId_ != 0; }
float getServerRunSpeed() const { return serverRunSpeed_; }
void dismount();
// Taxi / Flight Paths
bool isTaxiWindowOpen() const { return taxiWindowOpen_; }
void closeTaxi();
@ -630,6 +637,9 @@ private:
// ---- Teleport handler ----
void handleTeleportAck(network::Packet& packet);
// ---- Speed change handler ----
void handleForceRunSpeedChange(network::Packet& packet);
// ---- Taxi handlers ----
void handleShowTaxiNodes(network::Packet& packet);
void handleActivateTaxiReply(network::Packet& packet);
@ -844,6 +854,8 @@ private:
ShowTaxiNodesData currentTaxiData_;
uint64_t taxiNpcGuid_ = 0;
bool onTaxiFlight_ = false;
uint32_t knownTaxiMask_[12] = {}; // Track previously known nodes for discovery alerts
bool taxiMaskInitialized_ = false; // First SMSG_SHOWTAXINODES seeds mask without alerts
// Vendor
bool vendorWindowOpen = false;
@ -877,6 +889,9 @@ private:
NpcRespawnCallback npcRespawnCallback_;
MeleeSwingCallback meleeSwingCallback_;
NpcSwingCallback npcSwingCallback_;
MountCallback mountCallback_;
uint32_t currentMountDisplayId_ = 0;
float serverRunSpeed_ = 7.0f;
bool playerDead_ = false;
};