[Patch] GS/AITile.IsRiverTile

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
R2dical
Traffic Manager
Traffic Manager
Posts: 163
Joined: 18 Mar 2013 22:22

[Patch] GS/AITile.IsRiverTile

Post by R2dical »

I would like to suggest this patch for trunk, its not my work as Krinn wrote it, but I found I needed this while writing my AI.

Krinn made a FS Task, and I posted an updated patch in the AI/GS topic here.

Attached is latest trunk patch.

---

Another suggestion for the API, but no patch as yet:

Since buoys are "common property" it seems like the only reliable and fast way to get a working list of buoys would be to have a method to return an AI/GS list of tiles with buoys on. Any suggestions? Should I take a shot at coding this?



EDIT: Nevermind the second part, the Waypoint class allows this exact thing :roll:
Attachments
AIGS_IsRiver_r26416.patch
(5.81 KiB) Downloaded 80 times
Last edited by R2dical on 21 Mar 2014 17:53, edited 1 time in total.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: [Patch] GS/AITile.IsRiverTile

Post by Alberth »

no idea what BT_CLEAR_RIVER does, but it doesn't look related to an IsRiverTile test to me.
Perhaps split both additions?
R2dical
Traffic Manager
Traffic Manager
Posts: 163
Joined: 18 Mar 2013 22:22

Re: [Patch] GS/AITile.IsRiverTile

Post by R2dical »

Yeah, from Krinns FS Task post:
Krinn wrote:Here a patch that will :
- Add (AI/GS)Tile.IsRiverTile(tile)
- Add BT_CLEAR_RIVER to AI/GS enum BuildType
- Modify (AI/GS)Tile.GetBuildCost() to answer cost to remove a river tile
- Add AITile.GetBuildCost(AITile.BT_CLEAR_RIVER) to regression.nut : i didn't add the regression test against a tile to check river, because the regression.sav file didn't have any river to test against, and i assume it was over me to modify the testing savegame.
Attached is the patch with only "Add (AI/GS)Tile.IsRiverTile(tile)", the full one above includes the related bits.
Attachments
AIGS_IsRiver_only_r26416.patch
(3.31 KiB) Downloaded 70 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests