diff --git a/src/object/old_object.cpp b/src/object/old_object.cpp index 274885ac..269a66d8 100644 --- a/src/object/old_object.cpp +++ b/src/object/old_object.cpp @@ -442,7 +442,7 @@ void COldObject::DestroyObject(DestructionType type) SetShield(0.0f); } - Gfx::PyroType pyroType; + Gfx::PyroType pyroType = Gfx::PT_NULL; if ( type == DestructionType::Explosion ) // explosion? { if ( m_type == OBJECT_ANT || @@ -525,6 +525,7 @@ void COldObject::DestroyObject(DestructionType type) { pyroType = Gfx::PT_DEADW; } + assert(pyroType != Gfx::PT_NULL); m_engine->GetPyroManager()->Create(pyroType, this); if ( Implements(ObjectInterfaceType::Programmable) ) diff --git a/src/object/task/taskshield.cpp b/src/object/task/taskshield.cpp index f6fea0b0..4a9f426d 100644 --- a/src/object/task/taskshield.cpp +++ b/src/object/task/taskshield.cpp @@ -544,7 +544,7 @@ void CTaskShield::IncreaseShield() for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects()) { if (!obj->Implements(ObjectInterfaceType::Shielded)); - CShieldedObject* shielded = dynamic_cast(shielded); + CShieldedObject* shielded = dynamic_cast(obj); if (!shielded->IsRepairable()) continue; // NOTE: Looks like the original code forgot to check that Math::Vector oPos = obj->GetPosition();