Codechange: Don't scan vehicle pool to find targeting disaster vehicle when deleting any vehicle. (#12064)
* Codechange: Don't scan vehicle pool to find targeting disaster vehicle when deleting any vehicle. When deleting a vehicle, the vehicle pool is scanned to find a targetting disaster vehicle. With lots of vehicles this can take some time, especially when deleting multiple consecutive vehicles. Disasters vehicles can actually only target road vehicles. Store the DisasterVehicle index in the road vehicle, so that no pool scan is necessary. * Change: Small UFOs no longer target a vehicle which is already a target.
This commit is contained in:
@@ -168,7 +168,7 @@ bool CanVehicleUseStation(EngineID engine_type, const struct Station *st);
|
||||
bool CanVehicleUseStation(const Vehicle *v, const struct Station *st);
|
||||
StringID GetVehicleCannotUseStationReason(const Vehicle *v, const Station *st);
|
||||
|
||||
void ReleaseDisastersTargetingVehicle(VehicleID vehicle);
|
||||
void ReleaseDisasterVehicle(VehicleID vehicle);
|
||||
|
||||
typedef std::vector<VehicleID> VehicleSet;
|
||||
void GetVehicleSet(VehicleSet &set, Vehicle *v, uint8_t num_vehicles);
|
||||
|
||||
Reference in New Issue
Block a user