# HG changeset patch # User frosch # Date 2013-12-08 18:20:14 # Node ID 1ff014815343ee6194b55cfafdea090aa3b8331a # Parent d63e3d1dfbf812e7b1f7cee9a2ce6511fdb558dc (svn r26150) -Revert (r26120): EnforcePrecondition alters the last-error status and is only meant for commands. diff --git a/src/script/api/script_company.cpp b/src/script/api/script_company.cpp --- a/src/script/api/script_company.cpp +++ b/src/script/api/script_company.cpp @@ -246,7 +246,7 @@ /* static */ TileIndex ScriptCompany::GetCompanyHQ(CompanyID company) { company = ResolveCompanyID(company); - EnforcePrecondition(INVALID_TILE, company != COMPANY_INVALID); + if (company == COMPANY_INVALID) return INVALID_TILE; TileIndex loc = ::Company::Get((CompanyID)company)->location_of_HQ; return (loc == 0) ? INVALID_TILE : loc;