Skip to content

Update getLocationFlags to include tmFlags parameter - #804

Merged
tmewett merged 1 commit into
tmewett:masterfrom
drwjf:master
Mar 8, 2026
Merged

tmewett merged 1 commit into
tmewett:masterfrom
drwjf:master

Conversation

@drwjf

@drwjf drwjf commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@tmewett

tmewett commented Feb 23, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR - what issue does this solve?

@drwjf

drwjf commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the PR - what issue does this solve?

Line 6504 calls:
getLocationFlags(x, y, &tFlags, NULL, NULL, true);

so it updates tFlags but does not refresh tmFlags for the current (x, y).

As a result, the condition at line 6507:
!(tmFlags & TM_EXTINGUISHES_FIRE)

is evaluating tmFlags using the stale value last loaded at line 6487 (from impactLoc.x, impactLoc.y), not the tile currently being tested in the loop.

My thought: If the goal of this loop is to find a safe landing spot, tmFlags needs to be validated per candidate cell — meaning line 6504 should also retrieve tmFlags like tFlags.

@brturn

brturn commented Mar 3, 2026

Copy link
Copy Markdown
Collaborator

I agree that the fix implements the intended behavior. I’m having trouble finding a situation where this would change the behavior of the game. Is there a specific situation that brought this fix to your attention?

In order for the TMFlags to affect a blink path, it would have to be a path over lava where the terrain had TM_EXTINGUISHES_FIRE, but this only occurs for water tiles. Since water and lava occupy the same layer in the tile map, this should never occur.

Maybe a water trap that was activated next to lava?

@tmewett

tmewett commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Yeah, I'm mostly curious whether you observed a bug or this was found by reading/analysis. I'm happy to merge though, thanks

@tmewett
tmewett merged commit 2fb2de6 into tmewett:master Mar 8, 2026
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