Hi CodeMonkey,
Yes, the debug I did on the GetValidActionGridPositionList() please see above, had the logic from your interactAction file.
All the Actions have the same logic:
for (int x = -maxMoveDistance; x <= maxMoveDistance; x++) {
for (int z = -maxMoveDistance; z <= maxMoveDistance; z++) { }
When the grid was square, there were 9 positions when you include the unit. This logic can be found everywhere. Even in the UI for the soft_red color.
All I did was take the lookup and changed it to look for 6 positions, which are the interact positions around the unit.
The bug comes from looking up too many positions for the unit on the hex grid.
You get invalid results and it allows the unit to select a location that is out of reach to do the interaction. I made the same change to the swordAction and now I’m getting the correct results for that action as well.
I’m of the opinion that all of the locations where the logic is trying to find 9 positions should be turned into logic looking for 6 positions.
The pathfinding shouldn’t be effected because it goes one hex at a time and saves the location.
Hope this helps as to why my thinking is going down this path.