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.
This commit is contained in:
Peter Nelson 2024-03-18 23:39:42 +00:00 committed by GitHub
parent 7580eac2d5
commit 737e3feaf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -908,8 +908,10 @@ Vehicle::~Vehicle()
UpdateVehicleTileHash(this, true);
UpdateVehicleViewportHash(this, INVALID_COORD, 0, this->sprite_cache.old_coord.left, this->sprite_cache.old_coord.top);
DeleteVehicleNews(this->index, INVALID_STRING_ID);
DeleteNewGRFInspectWindow(GetGrfSpecFeature(this->type), this->index);
if (this->type != VEH_EFFECT) {
DeleteVehicleNews(this->index, INVALID_STRING_ID);
DeleteNewGRFInspectWindow(GetGrfSpecFeature(this->type), this->index);
}
}
/**