Fix: removing long roads doesn't prioritize refusal of local authority over other errors (#9831)

This commit is contained in:
Patric Stout 2022-03-11 16:18:09 +01:00 committed by GitHub
parent d220debc6c
commit 68ec2a7877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -1113,8 +1113,14 @@ std::tuple<CommandCost, Money> CmdRemoveLongRoad(DoCommandFlag flags, TileIndex
cost.AddCost(ret);
had_success = true;
} else {
/* Ownership errors are more important. */
if (last_error.GetErrorMessage() != STR_ERROR_OWNED_BY) last_error = ret;
/* Some errors are more equal than others. */
switch (last_error.GetErrorMessage()) {
case STR_ERROR_OWNED_BY:
case STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS:
break;
default:
last_error = ret;
}
}
}