From 22df872f2d16e9e6567355691832869fdcebc903 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 7 Jan 2024 19:05:12 -0600 Subject: [PATCH] allow misc health readouts to detect vehicles --- Engine/source/T3D/fps/guiHealthBarHud.cpp | 2 +- Engine/source/T3D/fps/guiHealthTextHud.cpp | 2 +- Engine/source/T3D/fps/guiShapeNameHud.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/source/T3D/fps/guiHealthBarHud.cpp b/Engine/source/T3D/fps/guiHealthBarHud.cpp index a01d17a69..a76f8284e 100644 --- a/Engine/source/T3D/fps/guiHealthBarHud.cpp +++ b/Engine/source/T3D/fps/guiHealthBarHud.cpp @@ -147,7 +147,7 @@ void GuiHealthBarHud::onRender(Point2I offset, const RectI &updateRect) if (!conn) return; ShapeBase* control = dynamic_cast(conn->getControlObject()); - if (!control || !(control->getTypeMask() & PlayerObjectType)) + if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType))) return; if(mDisplayEnergy) diff --git a/Engine/source/T3D/fps/guiHealthTextHud.cpp b/Engine/source/T3D/fps/guiHealthTextHud.cpp index 989287484..57b7f6751 100644 --- a/Engine/source/T3D/fps/guiHealthTextHud.cpp +++ b/Engine/source/T3D/fps/guiHealthTextHud.cpp @@ -149,7 +149,7 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect) if (!conn) return; ShapeBase* control = dynamic_cast(conn->getControlObject()); - if (!control || !(control->getTypeMask() & PlayerObjectType)) + if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType))) return; // Just grab the damage/energy right off the control object. diff --git a/Engine/source/T3D/fps/guiShapeNameHud.cpp b/Engine/source/T3D/fps/guiShapeNameHud.cpp index 27eca76f6..b293a4a87 100644 --- a/Engine/source/T3D/fps/guiShapeNameHud.cpp +++ b/Engine/source/T3D/fps/guiShapeNameHud.cpp @@ -209,7 +209,7 @@ void GuiShapeNameHud::onRender( Point2I, const RectI &updateRect) // Target pos to test, if it's a player run the LOS to his eye // point, otherwise we'll grab the generic box center. Point3F shapePos; - if (shape->getTypeMask() & PlayerObjectType) + if (shape->getTypeMask() & (PlayerObjectType | VehicleObjectType)) { MatrixF eye;