diff --git a/Runtime/World/CScriptDock.cpp b/Runtime/World/CScriptDock.cpp index c8516beb6..28100ff44 100644 --- a/Runtime/World/CScriptDock.cpp +++ b/Runtime/World/CScriptDock.cpp @@ -67,9 +67,10 @@ void CScriptDock::Think(float dt, CStateManager& mgr) { if (CObjectList* objs = mgr.GetWorld()->GetArea(aid)->GetAreaObjects()) { for (CEntity* ent : *objs) { - TCastToPtr dock(ent); - if (dock && dock->GetDockId() == otherDock) - dock->SetLoadConnected(mgr, true); + const TCastToPtr dock2(ent); + if (dock2 && dock2->GetDockId() == otherDock) { + dock2->SetLoadConnected(mgr, true); + } } } }