Codechange: Don't delete news items or NewGRF window when EffectVehicle is deleted. (#12334)

EffectVehicles never create news and can't be debugged, so searching for news items and windows to delete just wastes time.

(cherry picked from commit 737e3feaf0)
This commit is contained in:
Peter Nelson
2024-03-18 23:39:42 +00:00
committed by Jonathan G Rennison
parent fc4ea241b0
commit d7f029344f

View File

@@ -1278,9 +1278,11 @@ Vehicle::~Vehicle()
if (this->type < VEH_COMPANY_END) UpdateVehicleTileHash(this, true);
UpdateVehicleViewportHash(this, INVALID_COORD, 0);
if (this->type != VEH_EFFECT) {
DeleteVehicleNews(this->index, INVALID_STRING_ID);
DeleteNewGRFInspectWindow(GetGrfSpecFeature(this->type), this->index);
}
}
/**
* Vehicle pool is about to be cleaned