1
0
Fork 0

don't ignore the latest multiplayer pilot

This commit is contained in:
torsten 2009-09-05 20:22:14 +00:00
parent 9f28c3d5a9
commit 24204e2e75

View file

@ -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()))