(svn r9881) -Fix (FS#782, r9874): accidentally removed one condition too many causing asserts.
authorrubidium
Sat, 19 May 2007 20:15:50 +0000
changeset 7146 f51e7252112d
parent 7145 07c1f0c9e645
child 7147 d1a898108501
(svn r9881) -Fix (FS#782, r9874): accidentally removed one condition too many causing asserts.
src/autoreplace_cmd.cpp
--- a/src/autoreplace_cmd.cpp	Sat May 19 19:13:12 2007 +0000
+++ b/src/autoreplace_cmd.cpp	Sat May 19 20:15:50 2007 +0000
@@ -149,6 +149,8 @@
 		new_engine_type = EngineReplacementForPlayer(p, old_v->engine_type, old_v->group_id);
 	}
 
+	if (new_engine_type == INVALID_ENGINE) new_engine_type = old_v->engine_type;
+
 	replacement_cargo_type = GetNewCargoTypeForReplace(old_v, new_engine_type);
 
 	/* check if we can't refit to the needed type, so no replace takes place to prevent the vehicle from altering cargo type */