Jean Pellotier: don't show markers for invalid targets in HUD
Don't show invalid AI/MP models in the HUD (after they were removed from the scene). Also, when a radar is installed, consider radar/in-range for HUD display.
This commit is contained in:
parent
82bfb96d23
commit
d15d2ad270
1 changed files with 4 additions and 3 deletions
|
@ -274,9 +274,10 @@ void HUD::Ladder::draw(void)
|
||||||
SGPropertyNode *chld = models->getChild(i);
|
SGPropertyNode *chld = models->getChild(i);
|
||||||
string name;
|
string name;
|
||||||
name = chld->getName();
|
name = chld->getName();
|
||||||
if (name == "aircraft" || name == "multiplayer") {
|
if (name == "tanker" || name == "aircraft" || name == "multiplayer") {
|
||||||
string callsign = chld->getStringValue("callsign");
|
bool valid = chld->getBoolValue("valid");
|
||||||
if (callsign != "") {
|
bool in_range = chld->getBoolValue("radar/in-range", true);
|
||||||
|
if (valid && in_range) {
|
||||||
float h_deg = chld->getFloatValue("radar/h-offset");
|
float h_deg = chld->getFloatValue("radar/h-offset");
|
||||||
float v_deg = chld->getFloatValue("radar/v-offset");
|
float v_deg = chld->getFloatValue("radar/v-offset");
|
||||||
float pos_x = (h_deg * cos(roll_value) -
|
float pos_x = (h_deg * cos(roll_value) -
|
||||||
|
|
Loading…
Add table
Reference in a new issue