(svn r23622) -Add: a set of events to trigger in a GameScript

This commit is contained in:
truebrain
2011-12-19 20:59:36 +00:00
parent ac9324f270
commit bc78328918
15 changed files with 310 additions and 13 deletions

View File

@@ -27,6 +27,7 @@
#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"
@@ -2714,6 +2715,7 @@ static void TrainEnterStation(Train *v, StationID station)
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;
@@ -2840,6 +2842,7 @@ static uint TrainCrashed(Train *v)
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.