From 30c8326c3e218e6c2fda049775baa0b7e117e09c Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Sat, 11 Jun 2022 20:50:01 -0700 Subject: [PATCH] Move owner override Mover owner override to be earlier so that we dont try to get the team of an entity that doesnt have a team and may be a child entity of a player. Tested changes with a team of two players and players were correctly given credit for kills --- dGame/dComponents/DestroyableComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dGame/dComponents/DestroyableComponent.cpp b/dGame/dComponents/DestroyableComponent.cpp index da5db382..72194568 100644 --- a/dGame/dComponents/DestroyableComponent.cpp +++ b/dGame/dComponents/DestroyableComponent.cpp @@ -696,10 +696,10 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType if (owner != nullptr) { - auto* team = TeamManager::Instance()->GetTeam(owner->GetObjectID()); - owner = owner->GetOwner(); // If the owner is overwritten, we collect that here + auto* team = TeamManager::Instance()->GetTeam(owner->GetObjectID()); + const auto isEnemy = m_Parent->GetComponent() != nullptr; auto* inventoryComponent = owner->GetComponent();