diff --git a/src/openttd.cpp b/src/openttd.cpp index a106cec7b6..0d8cabc2ca 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1839,5 +1839,6 @@ char *DumpGameEventFlags(GameEventFlags events, char *b, const char *last) dump('c', GEF_TRAIN_CRASH); dump('i', GEF_INDUSTRY_CREATE); dump('j', GEF_INDUSTRY_DELETE); + dump('v', GEF_VIRT_TRAIN); return b; } diff --git a/src/openttd.h b/src/openttd.h index 39a5bf2825..8ea88939c7 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -95,6 +95,7 @@ enum GameEventFlags : uint32 { GEF_TRAIN_CRASH = 1 << 5, ///< (c) A train crash has occurred GEF_INDUSTRY_CREATE = 1 << 6, ///< (i) An industry has been created (in game) GEF_INDUSTRY_DELETE = 1 << 7, ///< (j) An industry has been deleted (in game) + GEF_VIRT_TRAIN = 1 << 8, ///< (v) A virtual train has been created }; DECLARE_ENUM_AS_BIT_SET(GameEventFlags) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index a682361bfa..2a146dc2a6 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -5255,6 +5255,8 @@ Train* CmdBuildVirtualRailVehicle(EngineID eid, StringID &error) return nullptr; } + RegisterGameEvents(GEF_VIRT_TRAIN); + if (rvi->railveh_type == RAILVEH_WAGON) { return CmdBuildVirtualRailWagon(e); }