@@ -28,6 +28,7 @@
#include "statusbar_gui.h"
#include "company_manager_face.h"
#include "company_func.h"
#include "engine_base.h"
#include "engine_gui.h"
#include "core/geometry_func.hpp"
@@ -809,6 +810,23 @@ void DeleteIndustryNews(IndustryID iid)
}
/**
* Remove engine announcements for invalid engines.
*/
void DeleteInvalidEngineNews()
{
NewsItem *ni = _oldest_news;
while (ni != NULL) {
NewsItem *next = ni->next;
if ((ni->reftype1 == NR_ENGINE && (!Engine::IsValidID(ni->ref1) || !Engine::Get(ni->ref1)->IsEnabled())) ||
(ni->reftype2 == NR_ENGINE && (!Engine::IsValidID(ni->ref2) || !Engine::Get(ni->ref2)->IsEnabled()))) {
DeleteNewsItem(ni);
ni = next;
static void RemoveOldNewsItems()
NewsItem *next;