(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

@@ -27,6 +27,7 @@
#include "depot.h"
#include "pbs.h"
#include "train.h"
#include "ai/ai_event.h"
enum {
/* Max stations: 64000 (64 * 1000) */
@@ -1463,6 +1464,9 @@ int32 CmdBuildRoadStop(int x, int y, uint32 flags, uint32 p1, uint32 p2)
UpdateStationVirtCoordDirty(st);
UpdateStationAcceptance(st, false);
InvalidateWindow(WC_STATION_LIST, st->owner);
ai_event(_current_player, ottd_Event_BuildStation, st->index, tile);
ai_event(_current_player, ottd_Event_BuildRoadStation, st->index, tile);
}
return cost;
}