CScriptDock: Get rid of variable shadowing

Same behavior, less bug vectors.
This commit is contained in:
Lioncash 2020-04-12 15:29:51 -04:00
parent 7fb2b6ac0b
commit 7df73b6f4c
1 changed files with 4 additions and 3 deletions

View File

@ -67,9 +67,10 @@ void CScriptDock::Think(float dt, CStateManager& mgr) {
if (CObjectList* objs = mgr.GetWorld()->GetArea(aid)->GetAreaObjects()) {
for (CEntity* ent : *objs) {
TCastToPtr<CScriptDock> dock(ent);
if (dock && dock->GetDockId() == otherDock)
dock->SetLoadConnected(mgr, true);
const TCastToPtr<CScriptDock> dock2(ent);
if (dock2 && dock2->GetDockId() == otherDock) {
dock2->SetLoadConnected(mgr, true);
}
}
}
}