(svn r18931) -Fix: Disabling autoreplace rules might count invalid engines.

This commit is contained in:
frosch
2010-01-27 20:54:05 +00:00
parent 7b237ee607
commit a3168269f9
2 changed files with 5 additions and 4 deletions

View File

@@ -50,9 +50,7 @@ static bool EnginesHaveCargoInCommon(EngineID engine_a, EngineID engine_b)
*/
bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
{
/* First we make sure that it's a valid type the user requested
* check that it's an engine that is in the engine array */
if (!Engine::IsValidID(from) || !Engine::IsValidID(to)) return false;
assert(Engine::IsValidID(from) && Engine::IsValidID(to));
/* we can't replace an engine into itself (that would be autorenew) */
if (from == to) return false;