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();
|
me.update();
|
||||||
},
|
},
|
||||||
update: func(n = nil) {
|
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;
|
return;
|
||||||
|
|
||||||
|
var changedNodeIndex = changedNode != nil ? changedNode.getIndex() : -1;
|
||||||
|
|
||||||
me.data = {};
|
me.data = {};
|
||||||
me.callsign = {};
|
me.callsign = {};
|
||||||
me.available = [];
|
me.available = [];
|
||||||
me.unavailable = [];
|
me.unavailable = [];
|
||||||
|
|
||||||
foreach (var n; props.globals.getNode("ai/models", 1).getChildren("multiplayer")) {
|
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;
|
continue;
|
||||||
|
|
||||||
if ((var callsign = n.getNode("callsign")) == nil or !(callsign = callsign.getValue()))
|
if ((var callsign = n.getNode("callsign")) == nil or !(callsign = callsign.getValue()))
|
||||||
|
|
Loading…
Add table
Reference in a new issue