mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-19 22:53:47 +00:00
handle relfecting the health of the controlled object
players and vehicles can both be the controlobject, or you can control a vehicle *through* a player. set the health bar/text controls to reflect that state
This commit is contained in:
parent
a996c09b04
commit
d0d2e1f343
2 changed files with 11 additions and 1 deletions
|
|
@ -148,7 +148,12 @@ void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
|
|||
GameConnection* conn = GameConnection::getConnectionToServer();
|
||||
if (!conn)
|
||||
return;
|
||||
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
|
||||
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
|
||||
|
||||
//cover the case of a connection controling an object in turn controlling another
|
||||
if (control && control->getControlObject())
|
||||
control = control->getControlObject();
|
||||
|
||||
if (!control || !(control->getTypeMask() & (PlayerObjectType | VehicleObjectType)))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue