TeamREPENTOGON / TeamREPENTOGON/REPENTOGON

Respawned Devil Deals (leaving and re-entering the room) are not initialised in MC_POST_PICKUP_INIT

Open
#819 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
345
Forks
51
Avg merge
11h 2m
Merged PRs (30d)
4

Description

Expected behaviour:

  • EntityPickup#IsShopItem() returns "true"
  • EntityPickup.ShopItemId returns correct Shop Item ID (e.g 0, 1, 2)
  • EntityPickup.Price returns correct price, e.g -3 (equivalent to PickupPrice.PRICE_THREE_SOULHEARTS)
  • EntityPickup#GetPriceSprite() returns a Sprite
  • Sprite#GetAnimation() returns "Hearts" (or otherwise correct Animation)
  • Sprite#GetFilename() returns correct File name
  • Sprite#GetFrame() returns correct frame (e.g 3, 5)

Actual/observed behaviour:

  • EntityPickup#IsShopItem() returns "false"

  • EntityPickup.ShopItemId returns 0 (in some cases this is correct, but it returns 0 regardless of correctness)

  • EntityPickup.Price returns 0

  • EntityPickup#GetPriceSprite() returns a Sprite (I thought this was worth noting as I'm not sure if non-Shop items return a Sprite at all, but it may not be of any value)

  • Sprite#GetAnimation() returns a blank string

  • Sprite#GetFilename() returns a blank string

  • Sprite#GetFrame() returns -1

Additional info:

  • MC_POST_PICKUP_INIT has the correct information for the initial deal spawn (when first entering the room), only despawned then respawned deals seem to be affected
  • MC_POST_PICKUP_MORPH is not called - I suspected it may spawn a blank collectible then morph it, but this does not appear to be the case.
  • MC_PRE_PICKUP_UPDATE (presumably any callback after MC_POST_PICKUP_INIT) has the correct information
  • This may affect other respawned entities besides Devil Deals but I haven't found any
  • Extremely simple mod used to test this (with no other mods enabled): https://pastes.io/local-mod-

This makes it very difficult to identify a respawned Devil Deal entity through callbacks in an efficient way (a callback that runs once, instead of every frame)

This may not be entirely a REPENTOGON issue but I felt it was relevant as the Sprite methods are inaccessible in the Vanilla API and would be a useful workaround on their own

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the minimal mod linked in the report: enter a room, observe the Devil Deal in MC_POST_PICKUP_INIT, leave and re-enter, then compare its properties in MC_POST_PICKUP_INIT and MC_PRE_PICKUP_UPDATE. Trace pickup callback handling for respawned deals and verify that shop status, price, and price-sprite data are initialized when the entity is first reported.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
Domain
api, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.