Skip to content

Cleanup and fix Dampe's race both prizes regression - #6999

Merged
serprex merged 2 commits into
HarbourMasters:developfrom
JordanLongstaff:dampe-both-prizes-fix
Aug 4, 2026
Merged

Cleanup and fix Dampe's race both prizes regression#6999
serprex merged 2 commits into
HarbourMasters:developfrom
JordanLongstaff:dampe-both-prizes-fix

Conversation

@JordanLongstaff

@JordanLongstaff JordanLongstaff commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

As reported on Discord:

On the latest nightly build I did the Dampe race several times but it only gives me PoH check, not the Hookshot chest check

I did a stupid when making that option by separating it into two hooks that were supposed to cover both rando and the option itself. The problem was that both hooks required the Hookshot slot check to be false, but then set to true, meaning that whichever hook ran first would override the other one. I've fixed this by uniting the two hooks into one. I also did a bit of syntax cleanup and renaming.

Hopefully someday I'll learn not to make that mistake again.

Build Artifacts

@djevangelia

djevangelia commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Good with better fix 👍
I wanted to fix it quickly because it was disruptive (but could thankfully be remedied with save editor).
Please next time, just let me know you'll fix it, so I can delete it and not have needing to go back and re-check if I missed something hanging over me.
I still don't think a custom treasure flag is needed, using the native EnBox flag for having received the randomizer check should be enough. If it is then again please tell me how so I can understand.

@JordanLongstaff

Copy link
Copy Markdown
Contributor Author

Please next time, just let me know you'll fix it, so I can delete it and not have needing to go back and re-check if I missed something hanging over me.

I'm sorry. You'd already put in a fix by the time I even saw that there was an issue, and it wasn't until later that I realized what I'd done wrong. I thought your fix would be good enough, but then it just sat there untouched for long enough that I decided to fix it my way. I was waiting for someone else to reply to your question about the treasure flag.

I still don't think a custom treasure flag is needed, using the native EnBox flag for having received the randomizer check should be enough. If it is then again please tell me how so I can understand.

That function call was added way back in #416 (author: @Kenix3). That's all I know. I have no idea how much has changed since then or if it still has a purpose.

@djevangelia djevangelia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all good!!
I've tested this fix on vanilla and randomizer with native treasure flag with/without Hookshot/flag set and it seems to work well. The custom flag maybe was required for earlier randomizer handling (can't find any targeted GetTreasure check for it).
Might want to clarify in the tooltip that it rewards the "within one minute" second reward only if you reach the goal within a minute, otherwise you get the junk reward.

Comment on lines +19 to +21
if (IS_RANDO) {
Flags_SetTreasure(gPlayState, 0x1E);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (IS_RANDO) {
Flags_SetTreasure(gPlayState, 0x1E);
}

Comment on lines 150 to 151
this->hookshotSlotFull =
(INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE && !IS_RANDO) || (IS_RANDO && Flags_GetTreasure(gPlayState, 0x1E));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this->hookshotSlotFull = !IS_RANDO ? (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE) : Flags_GetTreasure(gPlayState, 0);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know this isn't why the Flags_SetTreasure call is there?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably was originally, but because the temp Flags_SetTempClear(play, 4) is the only thing directly seen in the code, it wasn't clear that this leads to EnBox spawning, that when opened will set permanent Flags_SetTreasure for its treasure flag 0x0. So I think it was trying to add a permanent flag that in hindsight isn't necessary.

[z_actor.c:684] [info] Switch Flag Set - 0x34
[z_message_PAL.c:2686] [info] Display Text - textId: 0x502f
[z_message_PAL.c:2686] [info] Display Text - textId: 0x502d
[z_actor.c:752] [info] Treasure Flag Set - 0x1e
[z_actor.c:771] [info] Clear Flag Set - 0x4
[z_actor.c:752] [info] Treasure Flag Set - 0
[hook_handlers.cpp:391] [info] Queuing RC: 180
[hook_handlers.cpp:428] [info] Queuing Item mod 0 item 3 from RC 180
[hook_handlers.cpp:464] [info] Attempting to give Item mod 0 item 3 from RC 180
[z_message_PAL.c:2686] [info] Display Text - textId: 0x31
[z_parameter.c:1862] [info] Item Give - item: 0x3
[hook_handlers.cpp:481] [info] Item received mod 0 item 3 from RC 180
[SaveManager.cpp:1220] [info] Save File Finish - fileNum: 1

player->actor.world.pos.z) != 0) ||
(Math3D_PointInSquare2D(1580.0f, 2090.0f, -3030.0f, -2500.0f, player->actor.world.pos.x,
player->actor.world.pos.z) != 0)) {
speed = (this->hookshotSlotFull) ? player->actor.speedXZ * 1.4f : player->actor.speedXZ * 1.2f;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw in z_bg_relay_objects.c that there is an if (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE) check for timer length. As this->hookshotSlotFull also adjusts Dampe speed, should timer check also be changed to depend on treasure flag if randomizer?

@JordanLongstaff

Copy link
Copy Markdown
Contributor Author

Can I get a nudge on this? This should be merged as soon as possible, but I feel like this issue of the treasure flag needs to be resolved first.

@serprex
serprex merged commit 2fd7e05 into HarbourMasters:develop Aug 4, 2026
5 checks passed
@JordanLongstaff
JordanLongstaff deleted the dampe-both-prizes-fix branch August 4, 2026 16:44
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.

3 participants