Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "../TileMapState.func.hpp"

namespace OpenSHC {
namespace Map {

// FUNCTION: STRONGHOLDCRUSADER 0x00500370
BOOLEnum TileMapState::findTileInSameAreaAndNoTooHeightDifference(int area, int tile, int row)
{
int direction = 0;
int* neighborOffset = this->directionTranslationMatrix[row];
for (; direction < 8; ++direction, ++neighborOffset) {
int neighborTile = tile + *neighborOffset;
Comment on lines +9 to +12

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?

// This is an existence check, not a route search. Lower neighbors have
// no height restriction; a neighbor may be at most 16 units higher.
if (this->HeightLayer[neighborTile] <= this->HeightLayer[tile] + 16 &&
static_cast<short>(this->PathConnectionLayer[neighborTile]) == area) {
return TRUE;
}
}
return FALSE;
}

} // namespace Map
} // namespace OpenSHC
Loading