Skip to content

Fix creature corpse teleport during removal#356

Merged
MadMaxMangos merged 1 commit into
masterfrom
fix/corpse-teleport
Jun 8, 2026
Merged

Fix creature corpse teleport during removal#356
MadMaxMangos merged 1 commit into
masterfrom
fix/corpse-teleport

Conversation

@MadMaxMangos
Copy link
Copy Markdown
Member

@MadMaxMangos MadMaxMangos commented Jun 7, 2026

Summary

Fixes a creature corpse visibility issue where corpses could appear to snap or reappear at their respawn point during corpse cleanup.

Creature::RemoveCorpse() relocates the creature to its respawn coordinates before forcing corpse-removal visibility. The follow-up UpdateObjectVisibility() after restoring visibility could recreate the still-dead object for clients at the respawn position.

This removes that second visibility update while keeping the internal relocation required for respawn/grid state.

This also mitigates the known creature level-up visual/sound artifact for normal players during respawn, because the corpse/object is no longer recreated through the extra visibility update before the live respawn.

Behavior

Before:

  • Creature dies away from spawn.
  • Corpse remains at death location.
  • On corpse cleanup, corpse can visibly appear/snap to the spawn point.
  • Creature later respawns alive at spawn.

After:

  • Creature dies away from spawn.
  • Corpse despawns for normal players without visible teleport.
  • Creature still respawns alive at the correct spawn point.

Testing

Verified locally:

  • World creature corpse decay.
  • Manual .die + .respawn.
  • Automatic respawn at the expected spawn point.
  • Normal-player visibility with GM mode off.
  • Stockades instance trash respawn.
  • Level-ranged respawn changed level without visible level-up effect for a normal player view.

Notes

  • GMs with .gm on may still observe the hidden corpse/object state at the respawn point. Normal players do not see the corpse teleport/reappear.
  • This also mitigates the known client-side creature level-up visual/sound artifact during normal respawn. In testing, a level-ranged creature changed level on respawn without playing the player-style level-up effect. The root cause remains a client-side deferred-destroy/reuse-by-GUID behavior, so this PR describes it as a mitigation rather than a global client fix.

This change is Reviewable

Creature::RemoveCorpse() relocates the creature to its respawn
coordinates before forcing corpse removal visibility. A second
UpdateObjectVisibility() after restoring visibility could cause clients
to see the corpse recreated at the respawn point before the creature was
actually alive again.

Remove the second visibility update so the corpse is removed from normal
client view without being recreated at the respawn location. The internal
relocation remains in place for respawn/grid state.

Tested:
- world creature corpse decay
- manual .die + .respawn
- automatic respawn at spawn point
- normal-player visibility with GM mode off
- Stockades instance trash respawn
- level-ranged respawn without visible level-up effect
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@MadMaxMangos MadMaxMangos requested review from billy1arm June 7, 2026 22:47
@AppVeyorBot
Copy link
Copy Markdown

@MadMaxMangos MadMaxMangos merged commit 5ef19dc into master Jun 8, 2026
8 checks passed
@MadMaxMangos MadMaxMangos deleted the fix/corpse-teleport branch June 8, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants