Add event flag for removing invalid RVs during load
This commit is contained in:
@@ -42,6 +42,7 @@ char *DumpGameEventFlags(GameEventFlags events, char *b, const char *last)
|
|||||||
dump('i', GEF_INDUSTRY_CREATE);
|
dump('i', GEF_INDUSTRY_CREATE);
|
||||||
dump('j', GEF_INDUSTRY_DELETE);
|
dump('j', GEF_INDUSTRY_DELETE);
|
||||||
dump('v', GEF_VIRT_TRAIN);
|
dump('v', GEF_VIRT_TRAIN);
|
||||||
|
dump('r', GEF_RM_INVALID_RV);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@ enum GameEventFlags : uint32_t {
|
|||||||
GEF_INDUSTRY_CREATE = 1 << 6, ///< (i) An industry has been created (in game)
|
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_INDUSTRY_DELETE = 1 << 7, ///< (j) An industry has been deleted (in game)
|
||||||
GEF_VIRT_TRAIN = 1 << 8, ///< (v) A virtual train has been created
|
GEF_VIRT_TRAIN = 1 << 8, ///< (v) A virtual train has been created
|
||||||
|
GEF_RM_INVALID_RV = 1 << 9, ///< (r) Removed uncorrectable road vehicle on load
|
||||||
};
|
};
|
||||||
DECLARE_ENUM_AS_BIT_SET(GameEventFlags)
|
DECLARE_ENUM_AS_BIT_SET(GameEventFlags)
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "../error.h"
|
#include "../error.h"
|
||||||
#include "../strings_func.h"
|
#include "../strings_func.h"
|
||||||
#include "../economy_base.h"
|
#include "../economy_base.h"
|
||||||
|
#include "../event_logs.h"
|
||||||
#include "../3rdparty/cpp-btree/btree_map.h"
|
#include "../3rdparty/cpp-btree/btree_map.h"
|
||||||
#include "../core/format.hpp"
|
#include "../core/format.hpp"
|
||||||
|
|
||||||
@@ -575,6 +576,8 @@ void AfterLoadVehiclesRemoveAnyFoundInvalid()
|
|||||||
SetDParam(0, (uint)_load_invalid_vehicles_to_delete.size());
|
SetDParam(0, (uint)_load_invalid_vehicles_to_delete.size());
|
||||||
ShowErrorMessage(STR_WARNING_LOADGAME_REMOVED_UNCORRECTABLE_VEHICLES, INVALID_STRING_ID, WL_CRITICAL);
|
ShowErrorMessage(STR_WARNING_LOADGAME_REMOVED_UNCORRECTABLE_VEHICLES, INVALID_STRING_ID, WL_CRITICAL);
|
||||||
GroupStatistics::UpdateAfterLoad();
|
GroupStatistics::UpdateAfterLoad();
|
||||||
|
|
||||||
|
RegisterGameEvents(GEF_RM_INVALID_RV);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Vehicle *v : _load_invalid_vehicles_to_delete) {
|
for (Vehicle *v : _load_invalid_vehicles_to_delete) {
|
||||||
|
Reference in New Issue
Block a user