don't ignore the latest multiplayer pilot
This commit is contained in:
parent
9f28c3d5a9
commit
24204e2e75
1 changed files with 8 additions and 2 deletions
|
@ -363,16 +363,22 @@ var model = {
|
|||
me.update();
|
||||
},
|
||||
update: func(n = nil) {
|
||||
if (n != nil and props.globals.getNode(n, 1).getName() != "multiplayer")
|
||||
var changedNode = props.globals.getNode( n, 1 );
|
||||
if (n != nil and changedNode.getName() != "multiplayer")
|
||||
return;
|
||||
|
||||
var changedNodeIndex = changedNode != nil ? changedNode.getIndex() : -1;
|
||||
|
||||
me.data = {};
|
||||
me.callsign = {};
|
||||
me.available = [];
|
||||
me.unavailable = [];
|
||||
|
||||
foreach (var n; props.globals.getNode("ai/models", 1).getChildren("multiplayer")) {
|
||||
if (!n.getNode("valid", 1).getValue())
|
||||
# Ignore valid property for the newly added multiplayer aircraft.
|
||||
# It is false when model-added is triggered and will become true after this
|
||||
# listener is finished
|
||||
if (n.getIndex() != changedNodeIndex and !n.getNode("valid", 1).getValue())
|
||||
continue;
|
||||
|
||||
if ((var callsign = n.getNode("callsign")) == nil or !(callsign = callsign.getValue()))
|
||||
|
|
Loading…
Add table
Reference in a new issue