|
@@ -24,12 +24,13 @@
|
|
|
#include "strings_func.h"
|
|
|
#include "viewport_func.h"
|
|
|
#include "window_func.h"
|
|
|
#include "vehicle_func.h"
|
|
|
#include "sound_func.h"
|
|
|
#include "ai/ai.hpp"
|
|
|
#include "game/game.hpp"
|
|
|
#include "newgrf_station.h"
|
|
|
#include "effectvehicle_func.h"
|
|
|
#include "gamelog.h"
|
|
|
#include "network/network.h"
|
|
|
#include "spritecache.h"
|
|
|
#include "core/random_func.hpp"
|
|
@@ -2711,12 +2712,13 @@ static void TrainEnterStation(Train *v,
|
|
|
STR_NEWS_FIRST_TRAIN_ARRIVAL,
|
|
|
v->owner == _local_company ? NS_ARRIVAL_COMPANY : NS_ARRIVAL_OTHER,
|
|
|
v->index,
|
|
|
st->index
|
|
|
);
|
|
|
AI::NewEvent(v->owner, new ScriptEventStationFirstVehicle(st->index, v->index));
|
|
|
Game::NewEvent(new ScriptEventStationFirstVehicle(st->index, v->index));
|
|
|
}
|
|
|
|
|
|
v->force_proceed = TFP_NONE;
|
|
|
SetWindowDirty(WC_VEHICLE_VIEW, v->index);
|
|
|
|
|
|
v->BeginLoading();
|
|
@@ -2837,12 +2839,13 @@ static uint TrainCrashed(Train *v)
|
|
|
uint num = 0;
|
|
|
|
|
|
/* do not crash train twice */
|
|
|
if (!(v->vehstatus & VS_CRASHED)) {
|
|
|
num = v->Crash();
|
|
|
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_TRAIN));
|
|
|
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_TRAIN));
|
|
|
}
|
|
|
|
|
|
/* Try to re-reserve track under already crashed train too.
|
|
|
* Crash() clears the reservation! */
|
|
|
v->ReserveTrackUnderConsist();
|
|
|
|