Merge pull request #1173 from Azaezel/alpha41/hudwerk

allow misc health readouts to detect vehicles
This commit is contained in:
Brian Roberts 2024-01-08 17:09:59 -06:00 committed by GitHub
commit 6b1507f791
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)
return;
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
if (!control || !(control->getTypeMask() & PlayerObjectType))
if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType)))
return;
if(mDisplayEnergy)

View file

@ -149,7 +149,7 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
if (!conn)
return;
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
if (!control || !(control->getTypeMask() & PlayerObjectType))
if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType)))
return;
// 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
// point, otherwise we'll grab the generic box center.
Point3F shapePos;
if (shape->getTypeMask() & PlayerObjectType)
if (shape->getTypeMask() & (PlayerObjectType | VehicleObjectType))
{
MatrixF eye;