allow misc health readouts to detect vehicles

This commit is contained in:
AzaezelX 2024-01-07 19:05:12 -06:00
parent d22b7c7121
commit 22df872f2d
3 changed files with 3 additions and 3 deletions

View file

@ -147,7 +147,7 @@ void GuiHealthBarHud::onRender(Point2I offset, const RectI &updateRect)
if (!conn) if (!conn)
return; return;
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject()); ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
if (!control || !(control->getTypeMask() & PlayerObjectType)) if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType)))
return; return;
if(mDisplayEnergy) if(mDisplayEnergy)

View file

@ -149,7 +149,7 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
if (!conn) if (!conn)
return; return;
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject()); ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
if (!control || !(control->getTypeMask() & PlayerObjectType)) if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType)))
return; return;
// Just grab the damage/energy right off the control object. // Just grab the damage/energy right off the control object.

View file

@ -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 // Target pos to test, if it's a player run the LOS to his eye
// point, otherwise we'll grab the generic box center. // point, otherwise we'll grab the generic box center.
Point3F shapePos; Point3F shapePos;
if (shape->getTypeMask() & PlayerObjectType) if (shape->getTypeMask() & (PlayerObjectType | VehicleObjectType))
{ {
MatrixF eye; MatrixF eye;