(svn r13676) -Fix [FS#2126]: inactive companies from old (TTD) saves could be marked active in some cases, which then loads garbage in their statistics and such.
authorrubidium
Fri, 04 Jul 2008 19:00:11 +0000
changeset 11118 f66e0a4ce878
parent 11117 cb9c1d913f92
child 11119 abb5658c31c1
(svn r13676) -Fix [FS#2126]: inactive companies from old (TTD) saves could be marked active in some cases, which then loads garbage in their statistics and such.
src/oldloader.cpp
--- a/src/oldloader.cpp	Fri Jul 04 18:42:04 2008 +0000
+++ b/src/oldloader.cpp	Fri Jul 04 19:00:11 2008 +0000
@@ -1007,9 +1007,13 @@
 
 	if (!LoadChunk(ls, p, player_chunk)) return false;
 
+	if (_old_string_id == 0) {
+		p->is_active = false;
+		return true;
+	}
+
 	p->name_1 = RemapOldStringID(_old_string_id);
 	p->president_name_1 = RemapOldStringID(_old_string_id_2);
-	p->player_money = p->player_money;
 	_players_ai[_current_player_id].tick = ai_tick;
 
 	if (num == 0) {