summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 7e7959e26..ffecb7bac 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -24,6 +24,7 @@
#include "string_func.h"
#include "settings_type.h"
#include "oldpool_func.h"
+#include "ai/ai.hpp"
#include "core/alloc_func.hpp"
#include "vehicle_func.h"
@@ -376,14 +377,10 @@ void EnginesDailyLoop()
continue;
}
- if (!IsHumanCompany(best_company)) {
- /* XXX - TTDBUG: TTD has a bug here ???? */
- AcceptEnginePreview(i, best_company);
- } else {
- e->flags |= ENGINE_OFFER_WINDOW_OPEN;
- e->preview_wait = 20;
- if (IsInteractiveCompany(best_company)) ShowEnginePreviewWindow(i);
- }
+ e->flags |= ENGINE_OFFER_WINDOW_OPEN;
+ e->preview_wait = 20;
+ AI::NewEvent(best_company, new AIEventEnginePreview(i));
+ if (IsInteractiveCompany(best_company)) ShowEnginePreviewWindow(i);
}
}
}
@@ -460,6 +457,8 @@ static void NewVehicleAvailable(Engine *e)
FOR_ALL_COMPANIES(c) SetBit(c->avail_roadtypes, HasBit(e->info.misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD);
}
+ AI::BroadcastNewEvent(new AIEventEngineAvailable(index));
+
SetDParam(0, GetEngineCategoryName(index));
SetDParam(1, index);
AddNewsItem(STR_NEW_VEHICLE_NOW_AVAILABLE_WITH_TYPE, NS_NEW_VEHICLES, index, 0);