(svn r11271) -Fix [FS#1333]: some (very) old games (TTD original scenarios for example) would give a new vehicle spree, even though the vehicles were introduced decades ago.
authorrubidium
Mon, 15 Oct 2007 20:49:11 +0000
changeset 7736 0686379ea57b
parent 7735 45404d2baec5
child 7737 9d3de4ed7e60
(svn r11271) -Fix [FS#1333]: some (very) old games (TTD original scenarios for example) would give a new vehicle spree, even though the vehicles were introduced decades ago.
src/oldloader.cpp
--- a/src/oldloader.cpp	Mon Oct 15 20:33:11 2007 +0000
+++ b/src/oldloader.cpp	Mon Oct 15 20:49:11 2007 +0000
@@ -1617,6 +1617,16 @@
 		}
 	}
 
+	/* Make sure the available engines are really available, otherwise
+	 * we will get a "new vehicle"-spree. */
+	for (Engine *e = _engines; e != endof(_engines); e++) {
+		if (_date >= (e->intro_date + 365)) {
+			e->flags = (e->flags & ~ENGINE_EXCLUSIVE_PREVIEW) | ENGINE_AVAILABLE;
+			AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
+			e->player_avail = (byte)-1;
+		}
+	}
+
 	/* Fix the game to be compatible with OpenTTD */
 	FixOldTowns();
 	FixOldStations();