mirror of https://github.com/OpenTTD/OpenTTD
Codefix: 'Declaration hides variable'
parent
443d7ece29
commit
2d30df8110
|
@ -666,7 +666,7 @@ static CommandCost ReplaceChain(Vehicle **chain, DoCommandFlags flags, bool wago
|
|||
* Note: The vehicle attach callback is disabled here :) */
|
||||
if (!flags.Test(DoCommandFlag::Execute)) {
|
||||
/* Separate the head, so we can reattach the old vehicles */
|
||||
Train *second = Train::From(old_head)->GetNextUnit();
|
||||
second = Train::From(old_head)->GetNextUnit();
|
||||
if (second != nullptr) CmdMoveVehicle(second, nullptr, {DoCommandFlag::Execute, DoCommandFlag::AutoReplace}, true);
|
||||
|
||||
assert(Train::From(old_head)->GetNextUnit() == nullptr);
|
||||
|
|
|
@ -259,8 +259,7 @@ std::optional<FileHandle> FioFOpenFile(const std::string &filename, const char *
|
|||
/* Resolve ".." */
|
||||
std::istringstream ss(resolved_name);
|
||||
std::vector<std::string> tokens;
|
||||
std::string token;
|
||||
while (std::getline(ss, token, PATHSEPCHAR)) {
|
||||
for (std::string token; std::getline(ss, token, PATHSEPCHAR); /* nothing */) {
|
||||
if (token == "..") {
|
||||
if (tokens.size() < 2) return std::nullopt;
|
||||
tokens.pop_back();
|
||||
|
|
|
@ -1773,8 +1773,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
|
|||
i->type = type;
|
||||
|
||||
auto &industries = Industry::industries[type];
|
||||
auto it = std::ranges::lower_bound(industries, i->index);
|
||||
it = industries.emplace(it, i->index);
|
||||
industries.emplace(std::ranges::lower_bound(industries, i->index), i->index);
|
||||
|
||||
for (size_t index = 0; index < std::size(indspec->produced_cargo); ++index) {
|
||||
if (!IsValidCargoType(indspec->produced_cargo[index])) break;
|
||||
|
|
Loading…
Reference in New Issue