(svn r3253) -Add: add BuildRoad event for AIs
authortruelight
Fri, 02 Dec 2005 19:21:38 +0000
changeset 2709 d059af96a25b
parent 2708 9d1a8d5dc3ea
child 2710 e144188c1fdb
(svn r3253) -Add: add BuildRoad event for AIs
ai/ai_event.h
road_cmd.c
--- a/ai/ai_event.h	Fri Dec 02 14:55:23 2005 +0000
+++ b/ai/ai_event.h	Fri Dec 02 19:21:38 2005 +0000
@@ -53,6 +53,8 @@
 DEF_EVENTS int ottd_Event_RoadVehicleEnterDepot				INITIAL_SET; // (vehicle_index, depot_tile)
 
 DEF_EVENTS int ottd_Event_GiveOrder										INITIAL_SET; // (vehicle_index)
+
+DEF_EVENTS int ottd_Event_BuildRoad										INITIAL_SET; // (road_tile, road_pieces)
 /* ----------------- End of list ------------------ */
 
 #endif /* AI_EVENT */
--- a/road_cmd.c	Fri Dec 02 14:55:23 2005 +0000
+++ b/road_cmd.c	Fri Dec 02 19:21:38 2005 +0000
@@ -487,6 +487,8 @@
 		_m[tile].m5 |= pieces;
 
 		MarkTileDirtyByTile(tile);
+
+		ai_event(_current_player, ottd_Event_BuildRoad, tile, pieces);
 	}
 	return cost;
 }