Skip to content

Reimplement adjacent tile region and height check - #227

Open
Krarilotus wants to merge 1 commit into
sourcehold:mainfrom
Krarilotus:reimplement/moat-adjacent-access
Open

Krarilotus wants to merge 1 commit into
sourcehold:mainfrom
Krarilotus:reimplement/moat-adjacent-access

Conversation

@Krarilotus

@Krarilotus Krarilotus commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

TL;DR: Reconstruct the native neighboring-tile region and height check.

Moat selection uses this helper to ask whether a neighboring tile belongs to an area within the native height limit.

Changes: Implement TileMapState::findTileInSameAreaAndNoTooHeightDifference at 0x500370: examine eight offsets, allow at most 16 units upward and compare the signed region ID.

Review / testing: DLL build and 100% effective reccmp were reported; two independent setup instructions have different ordering. TheRedDaemon requested the matching status-file update, which is still absent from the current diff. This reconstructs existing behavior rather than changing moat routing.

@TheRedDaemon TheRedDaemon 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.

This is missing the matching status file update.

Comment on lines +9 to +12
int direction = 0;
int* neighborOffset = this->directionTranslationMatrix[row];
for (; direction < 8; ++direction, ++neighborOffset) {
int neighborTile = tile + *neighborOffset;

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.

Can you check if this loop would also work by index access and iterating over the directions?
Basically a normal for-loop and then using this->directionTranslationMatrix[row][direction]?
If not might neighborOffset[direction] possible, avoiding the pointer?

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