mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
fix: inspect (packed GUID), follow (client-side auto-walk); add loot/raid commands
Inspect: CMSG_INSPECT was writing full uint64 GUID instead of packed GUID. Server silently rejected the malformed packet. Fixed both InspectPacket and QueryInspectAchievementsPacket to use writePackedGuid(). Follow: was a no-op (only stored GUID). Added client-side auto-follow system: camera controller walks toward followed entity, faces target, cancels on WASD/mouse input, stops within 3 units, cancels at 40+ units distance. Party commands: - /lootmethod (ffa/roundrobin/master/group/nbg) sends CMSG_LOOT_METHOD - /lootthreshold (0-5 or quality name) sets minimum loot quality - /raidconvert converts party to raid (leader only) Equipment diagnostic logging still active for debugging naked players.
This commit is contained in:
parent
16fc3ebfdf
commit
b366773f29
8 changed files with 264 additions and 8 deletions
|
|
@ -96,6 +96,11 @@ public:
|
|||
// while server-sitting), so the caller can send CMSG_STAND_STATE_CHANGE(0).
|
||||
using StandUpCallback = std::function<void()>;
|
||||
void setStandUpCallback(StandUpCallback cb) { standUpCallback_ = std::move(cb); }
|
||||
|
||||
// Callback invoked when auto-follow is cancelled by user movement input.
|
||||
using AutoFollowCancelCallback = std::function<void()>;
|
||||
void setAutoFollowCancelCallback(AutoFollowCancelCallback cb) { autoFollowCancelCallback_ = std::move(cb); }
|
||||
|
||||
void setUseWoWSpeed(bool use) { useWoWSpeed = use; }
|
||||
void setRunSpeedOverride(float speed) { runSpeedOverride_ = speed; }
|
||||
void setWalkSpeedOverride(float speed) { walkSpeedOverride_ = speed; }
|
||||
|
|
@ -121,6 +126,13 @@ public:
|
|||
void clearMovementInputs();
|
||||
void suppressMovementFor(float seconds) { movementSuppressTimer_ = seconds; }
|
||||
|
||||
// Auto-follow: walk toward a target position each frame (WoW /follow).
|
||||
// The caller updates *targetPos every frame with the followed entity's render position.
|
||||
// Stops within FOLLOW_STOP_DIST; cancels on manual WASD input.
|
||||
void setAutoFollow(const glm::vec3* targetPos) { autoFollowTarget_ = targetPos; }
|
||||
void cancelAutoFollow() { autoFollowTarget_ = nullptr; }
|
||||
bool isAutoFollowing() const { return autoFollowTarget_ != nullptr; }
|
||||
|
||||
// Trigger mount jump (applies vertical velocity for physics hop)
|
||||
void triggerMountJump();
|
||||
|
||||
|
|
@ -259,6 +271,11 @@ private:
|
|||
bool autoRunning = false;
|
||||
bool tildeWasDown = false;
|
||||
|
||||
// Auto-follow target position (WoW /follow). Non-null when following.
|
||||
const glm::vec3* autoFollowTarget_ = nullptr;
|
||||
static constexpr float FOLLOW_STOP_DIST = 3.0f; // Stop within 3 units of target
|
||||
static constexpr float FOLLOW_MAX_DIST = 40.0f; // Cancel if > 40 units away
|
||||
|
||||
// Movement state tracking (for sending opcodes on state change)
|
||||
bool wasMovingForward = false;
|
||||
bool wasMovingBackward = false;
|
||||
|
|
@ -278,6 +295,7 @@ private:
|
|||
// Movement callback
|
||||
MovementCallback movementCallback;
|
||||
StandUpCallback standUpCallback_;
|
||||
AutoFollowCancelCallback autoFollowCancelCallback_;
|
||||
|
||||
// Movement speeds
|
||||
bool useWoWSpeed = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue