Merge pull request #256 from lioncash/binding

CActorContraption: Make use of structured bindings where applicable
This commit is contained in:
Phillip Stephens 2020-03-23 23:26:19 -07:00 committed by GitHub
commit 6c9d6bc38b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -53,11 +53,12 @@ void MP1::CActorContraption::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
void MP1::CActorContraption::Think(float dt, CStateManager& mgr) {
CScriptActor::Think(dt, mgr);
for (const std::pair<TUniqueId, std::string>& uid : x2e8_children) {
CFlameThrower* act = static_cast<CFlameThrower*>(mgr.ObjectById(uid.first));
for (const auto& [uid, name] : x2e8_children) {
auto* act = static_cast<CFlameThrower*>(mgr.ObjectById(uid));
if (act && act->GetActive())
act->SetTransform(x34_transform * GetScaledLocatorTransform(uid.second), dt);
if (act && act->GetActive()) {
act->SetTransform(x34_transform * GetScaledLocatorTransform(name), dt);
}
}
}