From dccda4db5690d357a7fe3d9b64740c954f728e93 Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 12:18:51 +0000 Subject: [PATCH] bugfix: Prevent crash when toppling non-existent shrubbery --- .../Source/GameLogic/Object/Update/TensileFormationUpdate.cpp | 2 +- .../Source/GameLogic/Object/Update/TensileFormationUpdate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp index a0e9296ccdc..204822c829c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp @@ -296,7 +296,7 @@ UpdateSleepTime TensileFormationUpdate::update() Object *tree = ThePartitionManager->getClosestObject( &newPos, getObject()->getGeometryInfo().getMajorRadius(), FROM_CENTER_2D ); - if (tree->isKindOf( KINDOF_SHRUBBERY )) + if (tree && tree->isKindOf( KINDOF_SHRUBBERY )) tree->topple( &m_inertia, m_inertia.length(), 1 );//No Bounce diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp index 66ef8bc1598..ec9c656d76a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp @@ -296,7 +296,7 @@ UpdateSleepTime TensileFormationUpdate::update() Object *tree = ThePartitionManager->getClosestObject( &newPos, getObject()->getGeometryInfo().getMajorRadius(), FROM_CENTER_2D ); - if (tree->isKindOf( KINDOF_SHRUBBERY )) + if (tree && tree->isKindOf( KINDOF_SHRUBBERY )) tree->topple( &m_inertia, m_inertia.length(), 1 );//No Bounce