Fix incorrect template replacement error message when chain not buildable
And no specific error returned See: #419
This commit is contained in:
@@ -7091,16 +7091,15 @@ CommandCost CmdTemplateReplaceVehicle(TileIndex tile, DoCommandFlag flags, uint3
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CommandCost buyCost = TestBuyAllTemplateVehiclesInChain(tv, tile);
|
CommandCost buyCost = TestBuyAllTemplateVehiclesInChain(tv, tile);
|
||||||
if (!buyCost.Succeeded() || !CheckCompanyHasMoney(buyCost)) {
|
if (!buyCost.Succeeded()) {
|
||||||
if (leaveDepot) incoming->vehstatus &= ~VS_STOPPED;
|
if (leaveDepot) incoming->vehstatus &= ~VS_STOPPED;
|
||||||
|
if (buyCost.GetErrorMessage() == INVALID_STRING_ID) return_cmd_error(STR_ERROR_CAN_T_BUY_TRAIN);
|
||||||
if (!buyCost.Succeeded() && buyCost.GetErrorMessage() != INVALID_STRING_ID) {
|
|
||||||
return buyCost;
|
return buyCost;
|
||||||
} else {
|
} else if (!CheckCompanyHasMoney(buyCost)) {
|
||||||
|
if (leaveDepot) incoming->vehstatus &= ~VS_STOPPED;
|
||||||
return_cmd_error(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY);
|
return_cmd_error(STR_ERROR_NOT_ENOUGH_CASH_REQUIRES_CURRENCY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (need_replacement || (need_refit && use_refit)) RegisterGameEvents(GEF_TBTR_REPLACEMENT);
|
if (need_replacement || (need_refit && use_refit)) RegisterGameEvents(GEF_TBTR_REPLACEMENT);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user