diff options
author | truelight <truelight@openttd.org> | 2005-11-23 15:08:29 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-11-23 15:08:29 +0000 |
commit | 8733f49e883249117580bb8457266cde858f6bac (patch) | |
tree | 39b2634d00d2ef0c50327795368bd790f4a2d3af /road_cmd.c | |
parent | b8f8f3869d3e16aa914133c3ba2c4a66a94068bc (diff) | |
download | openttd-8733f49e883249117580bb8457266cde858f6bac.tar.xz |
(svn r3232) -Add: implemented the event-system for AIs
-Add: added several hooks (event-callbacks) for road-related-stuff
Diffstat (limited to 'road_cmd.c')
-rw-r--r-- | road_cmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/road_cmd.c b/road_cmd.c index 34382402c..4592bd7a0 100644 --- a/road_cmd.c +++ b/road_cmd.c @@ -17,6 +17,7 @@ #include "depot.h" #include "pbs.h" #include "debug.h" +#include "ai/ai_event.h" /* When true, GetTrackStatus for roads will treat roads under reconstruction * as normal roads instead of impassable. This is used when detecting whether @@ -671,6 +672,8 @@ int32 CmdBuildRoadDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2) (p1 | 0x20) /* map5 */ ); + ai_event(_current_player, ottd_Event_BuildDepot, dep->index, tile); + ai_event(_current_player, ottd_Event_BuildRoadDepot, dep->index, tile); } return cost + _price.build_road_depot; } @@ -1156,6 +1159,10 @@ static uint32 VehicleEnter_Road(Vehicle *v, TileIndex tile, int x, int y) if (v->type == VEH_Road && v->u.road.frame == 11) { if (_roadveh_enter_depot_unk0[GB(_m[tile].m5, 0, 2)] == v->u.road.state) { RoadVehEnterDepot(v); + + ai_event(v->owner, ottd_Event_VehicleEnterDepot, v->index, tile); + ai_event(v->owner, ottd_Event_RoadVehicleEnterDepot, v->index, tile); + return 4; } } |