(svn r3232) -Add: implemented the event-system for AIs

-Add: added several hooks (event-callbacks) for road-related-stuff
This commit is contained in:
truelight
2005-11-23 15:08:29 +00:00
parent b8f8f3869d
commit 8733f49e88
6 changed files with 81 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
#include "sound.h"
#include "depot.h"
#include "vehicle_gui.h"
#include "ai/ai_event.h"
void ShowRoadVehViewWindow(Vehicle *v);
@@ -195,6 +196,9 @@ int32 CmdBuildRoadVeh(int x, int y, uint32 flags, uint32 p1, uint32 p2)
InvalidateWindow(WC_COMPANY, v->owner);
if (IsLocalPlayer())
InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Road); // updates the replace Road window
ai_event(_current_player, ottd_Event_BuildVehicle, v->index, tile);
ai_event(_current_player, ottd_Event_BuildRoadVehicle, v->index, tile);
}
return cost;