Show corpse distance on reclaim corpse button

When the player is a ghost, the 'Resurrect from Corpse' popup now shows how many yards away the corpse is, updating in real-time as the ghost moves. Distance is only shown when the corpse is on the same map.
This commit is contained in:
Kelsi 2026-03-11 22:41:26 -07:00
parent 355001c236
commit b2d1edc9db
2 changed files with 16 additions and 0 deletions

View file

@ -888,6 +888,14 @@ public:
void cancelTalentWipe() { talentWipePending_ = false; }
/** True when ghost is within 40 yards of corpse position (same map). */
bool canReclaimCorpse() const;
/** Distance (yards) from ghost to corpse, or -1 if no corpse data. */
float getCorpseDistance() const {
if (corpseMapId_ == 0 || currentMapId_ != corpseMapId_) return -1.0f;
float dx = movementInfo.x - corpseX_;
float dy = movementInfo.y - corpseY_;
float dz = movementInfo.z - corpseZ_;
return std::sqrt(dx*dx + dy*dy + dz*dz);
}
/** Send CMSG_RECLAIM_CORPSE; noop if not a ghost or not near corpse. */
void reclaimCorpse();
void releaseSpirit();