CScriptActorKeyframe: Eliminate variable shadowing

This commit is contained in:
Lioncash 2020-04-23 07:22:10 -04:00
parent 9ec9f42457
commit 4e3363a98b
1 changed files with 5 additions and 4 deletions

View File

@ -91,10 +91,11 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr) {
void CScriptActorKeyframe::UpdateEntity(TUniqueId uid, CStateManager& mgr) { void CScriptActorKeyframe::UpdateEntity(TUniqueId uid, CStateManager& mgr) {
CEntity* ent = mgr.ObjectById(uid); CEntity* ent = mgr.ObjectById(uid);
CActor* act = nullptr; CActor* act = nullptr;
if (TCastToPtr<CScriptActor> tmp = ent) if (const TCastToPtr<CScriptActor> actor = ent) {
act = tmp; act = actor.GetPtr();
else if (TCastToPtr<CScriptPlatform> tmp = ent) } else if (const TCastToPtr<CScriptPlatform> platform = ent) {
act = tmp; act = platform.GetPtr();
}
if (act) { if (act) {
if (!act->GetActive()) if (!act->GetActive())