summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-05-26 14:16:07 +0000
committerfrosch <frosch@openttd.org>2012-05-26 14:16:07 +0000
commit01100053ff5308e0a07b1faa449255527cc12c31 (patch)
tree7f5bb0b41cc051cc6927dc9ed454ce74b05db362 /src/news_gui.cpp
parenta8c88f43b678b6d44e1fb4f78a51cdb7fb08a8aa (diff)
downloadopenttd-01100053ff5308e0a07b1faa449255527cc12c31.tar.xz
(svn r24285) -Codechange: Add a more explcit NewsFlag to indicate that the first string parameter is a vehicle ID.
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 023cd2082..7efa2b212 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -846,15 +846,7 @@ void ChangeVehicleNews(VehicleID from_index, VehicleID to_index)
for (NewsItem *ni = _oldest_news; ni != NULL; ni = ni->next) {
if (ni->reftype1 == NR_VEHICLE && ni->ref1 == from_index) ni->ref1 = to_index;
if (ni->reftype2 == NR_VEHICLE && ni->ref2 == from_index) ni->ref2 = to_index;
-
- /* Oh noes :(
- * Autoreplace is breaking the whole news-reference concept here, as we want to keep the news,
- * but do not know which DParams to change.
- *
- * Currently only NT_ADVICE news have vehicle IDs in their DParams.
- * And all NT_ADVICE news have the ID in param 0.
- */
- if (ni->type == NT_ADVICE && ni->params[0] == from_index) ni->params[0] = to_index;
+ if (ni->flags & NF_VEHICLE_PARAM0 && ni->params[0] == from_index) ni->params[0] = to_index;
}
}