mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r22947) -Fix: [NewGRF] Do not call CB 32 for disaster, effect vehicles or aircraft shadows/rotors.
This commit is contained in:
parent
427dd736ae
commit
2188383658
|
@ -631,6 +631,21 @@ bool Vehicle::IsEngineCountable() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether Vehicle::engine_type has any meaning.
|
||||||
|
* @return true if the vehicle has a useable engine type.
|
||||||
|
*/
|
||||||
|
bool Vehicle::HasEngineType() const
|
||||||
|
{
|
||||||
|
switch (this->type) {
|
||||||
|
case VEH_AIRCRAFT: return Aircraft::From(this)->IsNormalAircraft();
|
||||||
|
case VEH_TRAIN:
|
||||||
|
case VEH_ROAD:
|
||||||
|
case VEH_SHIP: return true;
|
||||||
|
default: return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the pathfinding result, especially the lost status.
|
* Handle the pathfinding result, especially the lost status.
|
||||||
* If the vehicle is now lost and wasn't previously fire an
|
* If the vehicle is now lost and wasn't previously fire an
|
||||||
|
@ -784,7 +799,7 @@ static void RunVehicleDayProc()
|
||||||
if (v == NULL) continue;
|
if (v == NULL) continue;
|
||||||
|
|
||||||
/* Call the 32-day callback if needed */
|
/* Call the 32-day callback if needed */
|
||||||
if ((v->day_counter & 0x1F) == 0) {
|
if ((v->day_counter & 0x1F) == 0 && v->HasEngineType()) {
|
||||||
uint16 callback = GetVehicleCallback(CBID_VEHICLE_32DAY_CALLBACK, 0, 0, v->engine_type, v);
|
uint16 callback = GetVehicleCallback(CBID_VEHICLE_32DAY_CALLBACK, 0, 0, v->engine_type, v);
|
||||||
if (callback != CALLBACK_FAILED) {
|
if (callback != CALLBACK_FAILED) {
|
||||||
if (HasBit(callback, 0)) TriggerVehicle(v, VEHICLE_TRIGGER_CALLBACK_32); // Trigger vehicle trigger 10
|
if (HasBit(callback, 0)) TriggerVehicle(v, VEHICLE_TRIGGER_CALLBACK_32); // Trigger vehicle trigger 10
|
||||||
|
|
|
@ -703,6 +703,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsEngineCountable() const;
|
bool IsEngineCountable() const;
|
||||||
|
bool HasEngineType() const;
|
||||||
bool HasDepotOrder() const;
|
bool HasDepotOrder() const;
|
||||||
void HandlePathfindingResult(bool path_found);
|
void HandlePathfindingResult(bool path_found);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue