Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player ghost cosmetics fixes, refactoring #86

Merged
merged 4 commits into from
Sep 25, 2023

Conversation

tehkab
Copy link
Collaborator

@tehkab tehkab commented Sep 21, 2023

Some (WIP) improvements to player ghost cosmetics (crown, amulet, more to come?) and other player ghost tracking

  • Moving player ghost related code from utils.lua to a separate utils/player_ghosts.lua. This gets included by utils.lua, so shouldn't change much in itself.
  • Caching player's player-ghost entity id in the player's entry in the PlayerList table. This allows quick access to the ghost entity without having to iterate over all (up to 90!) ghost entities every time we do something
  • Storing the player-ghost cosmetic flags in the same PlayerList table entry. This allows player-ghosts to get their crowns and amulets back when you hide and re-show ghosts. Fixes Investigate hiding player ghosts and showing them again may lose crown/amulet states #82
  • Wands no longer disappear when hiding and re-showing ghosts either

Need to periodically (and/or on change/request) re-send cosmetic information; ghost cosmetics and held wand also disappear when mod restarting (and we lose track of them in the PlayerList) Let's leave resyncing PlayerList state after a mod restart to another PR for now?

@tehkab tehkab marked this pull request as ready for review September 23, 2023 22:25
@SkyeOfBreeze SkyeOfBreeze merged commit 6a1913d into Noita-Together:main Sep 25, 2023
@tehkab tehkab deleted the fix-ghost-cosmetics branch September 25, 2023 01:42
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.

Investigate hiding player ghosts and showing them again may lose crown/amulet states
2 participants