mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Add game event for TBTR replacement attempt
This commit is contained in:
parent
2740537632
commit
5b7d1f7f80
@ -1730,5 +1730,6 @@ char *DumpGameEventFlags(GameEventFlags events, char *b, const char *last)
|
||||
dump('d', GEF_COMPANY_DELETE);
|
||||
dump('m', GEF_COMPANY_MERGE);
|
||||
dump('n', GEF_RELOAD_NEWGRF);
|
||||
dump('t', GEF_TBTR_REPLACEMENT);
|
||||
return b;
|
||||
}
|
||||
|
@ -91,6 +91,7 @@ enum GameEventFlags : uint32 {
|
||||
GEF_COMPANY_DELETE = 1 << 0, ///< (d) A company has been deleted
|
||||
GEF_COMPANY_MERGE = 1 << 1, ///< (m) A company has been bought by another
|
||||
GEF_RELOAD_NEWGRF = 1 << 2, ///< (n) ReloadNewGRFData() has been called
|
||||
GEF_TBTR_REPLACEMENT = 1 << 3, ///< (t) CMD_TEMPLATE_REPLACE_VEHICLE has been called
|
||||
};
|
||||
DECLARE_ENUM_AS_BIT_SET(GameEventFlags)
|
||||
|
||||
|
@ -1379,6 +1379,8 @@ void CallVehicleTicks()
|
||||
bool leaveDepot = it->second;
|
||||
_vehicles_to_autoreplace.erase(it);
|
||||
|
||||
RegisterGameEvents(GEF_TBTR_REPLACEMENT);
|
||||
|
||||
/* Store the position of the effect as the vehicle pointer will become invalid later */
|
||||
int x = t->x_pos;
|
||||
int y = t->y_pos;
|
||||
|
Loading…
Reference in New Issue
Block a user