Skip to content

Fix graves spawning at stale instance exit tiles - #1179

Merged
GregHib merged 1 commit into
GregHib:mainfrom
HarleyGilpin:bug/fix-grave-markers-in-gwd
Aug 17, 2026
Merged

Fix graves spawning at stale instance exit tiles#1179
GregHib merged 1 commit into
GregHib:mainfrom
HarleyGilpin:bug/fix-grave-markers-in-gwd

Conversation

@HarleyGilpin

@HarleyGilpin HarleyGilpin commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Problem

instanceLogout() reads the player var instance_logout_tile, which is set when entering an instance (LumbridgeCatacombs, HuntForSurok, Edmond, PollnivneachDungeon, and every random event via random_event_origin) and was never cleared — clearInstance() removed instance and instance_offset but not this one. The var is persisted in the save's [variables], so a single Blood Pact run or random event permanently redirected every later death, anywhere in the game, to that old exit tile.

instanceOrigin() has the same latent flaw: entering a later instance that doesn't set its own logout tile would teleport the player to the stale one on exit.

Fix

  • PlayerDeath only uses the instance exit tile while the player is actually inside an instance.
  • clearInstance() clears instance_logout_tile alongside instance_offset.
  • InstanceLogout clears it on spawn when not in an instance, so saves that already carry a stale value recover on next login.

Testing

New GravestonesTest case: with a stale logout tile set, die in the Bandos chamber and assert the grave and dropped items are at the death tile and nothing lands on the logout tile. Full :game:test suite passes.

`instance_logout_tile` was set when entering an instance and never
cleared, so after Blood Pact or any random event every later death sent
the gravestone and dropped items back to that old exit tile - dying in
God Wars Dungeon left the grave outside Lumbridge church.

Only use the instance exit tile while the player is actually inside an
instance, clear the var in clearInstance() (which also fixes
instanceOrigin() teleporting to a long-gone tile on a later instance
exit), and clear it on spawn so existing saves recover.
@HarleyGilpin
HarleyGilpin marked this pull request as ready for review August 17, 2026 10:44
@GregHib
GregHib merged commit 24afa04 into GregHib:main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants