From a3168269f9920e764669d7d63abff9ec5fe332d0 Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 27 Jan 2010 20:54:05 +0000 Subject: (svn r18931) -Fix: Disabling autoreplace rules might count invalid engines. --- src/autoreplace_cmd.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/autoreplace_cmd.cpp') diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index bb2cf0b02..26a92e519 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -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; -- cgit v1.2.3-54-g00ecf