mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 16:27:43 +00:00
General: Make use of emplace_back where applicable
Allows for in-place construction. Also results in less code to read in certain usages.
This commit is contained in:
@@ -89,10 +89,10 @@ float CScriptPickupGenerator::GetPickupTemplates(CStateManager& mgr,
|
||||
doAlways = true;
|
||||
break;
|
||||
}
|
||||
bool thirtyPercTest = mgr.GetActiveRandom()->Float() < 0.3f;
|
||||
const bool thirtyPercTest = mgr.GetActiveRandom()->Float() < 0.3f;
|
||||
if ((doAlways || (doThirtyPerc && thirtyPercTest)) && possibility > 0.f) {
|
||||
totalPossibility += possibility * multiplier;
|
||||
idsOut.push_back(std::make_pair(possibility, conn.x8_objId));
|
||||
idsOut.emplace_back(possibility, conn.x8_objId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user