mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 22:13:07 +01:00
Only fallback if only one element differs
This commit is contained in:
@@ -54,17 +54,6 @@ bool GeneralSupportHeightCall::FindMostCommonSupportCall(SupportCall calls[4], S
|
||||
return false;
|
||||
}
|
||||
|
||||
if (map.size() == 3) {
|
||||
for (auto &&item : map) {
|
||||
if (item.second == 2) {
|
||||
(*out) = item.first;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,16 +137,5 @@ bool SegmentSupportHeightCall::FindMostCommonSupportCall(std::vector<SegmentSupp
|
||||
return false;
|
||||
}
|
||||
|
||||
if (map.size() == 3) {
|
||||
for (auto &&item : map) {
|
||||
if (item.second == 2) {
|
||||
(*out) = item.first;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -416,8 +416,7 @@ static void TestGeneralSupportHeightCall() {
|
||||
|
||||
SupportCall groupD[4] = {callB, callC, callB, callA};
|
||||
success = GeneralSupportHeightCall::FindMostCommonSupportCall(groupD, &out);
|
||||
assert(success);
|
||||
assert(out == callB);
|
||||
assert(!success);
|
||||
|
||||
SupportCall groupE[4] = {callD, callC, callB, callA};
|
||||
success = GeneralSupportHeightCall::FindMostCommonSupportCall(groupE, &out);
|
||||
|
||||
Reference in New Issue
Block a user