From dc960cb99cf8026a4e8335821ea3f7ed51dd9b32 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Mon, 8 Aug 2022 07:34:33 -0700 Subject: [PATCH] Fix landing animation (#720) --- dGame/dComponents/CharacterComponent.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dGame/dComponents/CharacterComponent.cpp b/dGame/dComponents/CharacterComponent.cpp index 42b8ed34..d425c066 100644 --- a/dGame/dComponents/CharacterComponent.cpp +++ b/dGame/dComponents/CharacterComponent.cpp @@ -36,15 +36,6 @@ CharacterComponent::CharacterComponent(Entity* parent, Character* character) : C m_CurrentActivity = 0; m_CountryCode = 0; m_LastUpdateTimestamp = std::time(nullptr); - - //Check to see if we're landing: - if (character->GetZoneID() != Game::server->GetZoneID()) { - m_IsLanding = true; - } - - if (LandingAnimDisabled(character->GetZoneID()) || LandingAnimDisabled(Game::server->GetZoneID()) || m_LastRocketConfig.empty()) { - m_IsLanding = false; //Don't make us land on VE/minigames lol - } } bool CharacterComponent::LandingAnimDisabled(int zoneID) { @@ -273,6 +264,17 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) { } else { m_TotalTimePlayed = 0; } + + if (!m_Character) return; + + //Check to see if we're landing: + if (m_Character->GetZoneID() != Game::server->GetZoneID()) { + m_IsLanding = true; + } + + if (LandingAnimDisabled(m_Character->GetZoneID()) || LandingAnimDisabled(Game::server->GetZoneID()) || m_LastRocketConfig.empty()) { + m_IsLanding = false; //Don't make us land on VE/minigames lol + } } void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {