Add game event for train crash
This commit is contained in:
@@ -1813,5 +1813,6 @@ char *DumpGameEventFlags(GameEventFlags events, char *b, const char *last)
|
|||||||
dump('n', GEF_RELOAD_NEWGRF);
|
dump('n', GEF_RELOAD_NEWGRF);
|
||||||
dump('t', GEF_TBTR_REPLACEMENT);
|
dump('t', GEF_TBTR_REPLACEMENT);
|
||||||
dump('D', GEF_DISASTER_VEH);
|
dump('D', GEF_DISASTER_VEH);
|
||||||
|
dump('c', GEF_TRAIN_CRASH);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
@@ -93,6 +93,7 @@ enum GameEventFlags : uint32 {
|
|||||||
GEF_RELOAD_NEWGRF = 1 << 2, ///< (n) ReloadNewGRFData() has been called
|
GEF_RELOAD_NEWGRF = 1 << 2, ///< (n) ReloadNewGRFData() has been called
|
||||||
GEF_TBTR_REPLACEMENT = 1 << 3, ///< (t) CMD_TEMPLATE_REPLACE_VEHICLE has been called
|
GEF_TBTR_REPLACEMENT = 1 << 3, ///< (t) CMD_TEMPLATE_REPLACE_VEHICLE has been called
|
||||||
GEF_DISASTER_VEH = 1 << 4, ///< (D) A disaster vehicle exists or has been created
|
GEF_DISASTER_VEH = 1 << 4, ///< (D) A disaster vehicle exists or has been created
|
||||||
|
GEF_TRAIN_CRASH = 1 << 5, ///< (c) A train crash has occurred
|
||||||
};
|
};
|
||||||
DECLARE_ENUM_AS_BIT_SET(GameEventFlags)
|
DECLARE_ENUM_AS_BIT_SET(GameEventFlags)
|
||||||
|
|
||||||
|
@@ -3540,6 +3540,8 @@ uint Train::Crash(bool flooded)
|
|||||||
HideFillingPercent(&this->fill_percent_te_id);
|
HideFillingPercent(&this->fill_percent_te_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RegisterGameEvents(GEF_TRAIN_CRASH);
|
||||||
|
|
||||||
pass += this->GroundVehicleBase::Crash(flooded);
|
pass += this->GroundVehicleBase::Crash(flooded);
|
||||||
|
|
||||||
this->crash_anim_pos = flooded ? 4000 : 1; // max 4440, disappear pretty fast when flooded
|
this->crash_anim_pos = flooded ? 4000 : 1; // max 4440, disappear pretty fast when flooded
|
||||||
|
Reference in New Issue
Block a user