1
0
Fork 0

Carriers: fix dialog nasal

Prevent nil dereference when empty nodes do not have a valid name node.
This commit is contained in:
Richard Harrison 2021-06-05 16:18:58 +02:00
parent 2b11545fdf
commit 63debb7d63
6 changed files with 18 additions and 18 deletions

View file

@ -62,7 +62,7 @@
var v = getprop("/controls/clemenceau/turn-to-launch-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Clemenceau")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Clemenceau")
{
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
@ -92,7 +92,7 @@
var v = getprop("/controls/clemenceau/turn-to-recovery-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Clemenceau")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Clemenceau")
{
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
@ -122,7 +122,7 @@
var v = getprop("/controls/clemenceau/turn-to-base-course");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Clemenceau")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Clemenceau")
{
c.getNode("controls/turn-to-base-course").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);

View file

@ -62,7 +62,7 @@
var v = getprop("/controls/eisenhower/turn-to-launch-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Eisenhower")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Eisenhower")
{
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
@ -92,7 +92,7 @@
var v = getprop("/controls/eisenhower/turn-to-recovery-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Eisenhower")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Eisenhower")
{
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
@ -122,7 +122,7 @@
var v = getprop("/controls/eisenhower/turn-to-base-course");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Eisenhower")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Eisenhower")
{
c.getNode("controls/turn-to-base-course").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);

View file

@ -62,7 +62,7 @@
var v = getprop("/controls/nimitz/turn-to-launch-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Nimitz")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Nimitz")
{
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
@ -92,7 +92,7 @@
var v = getprop("/controls/nimitz/turn-to-recovery-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Nimitz")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Nimitz")
{
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
@ -122,7 +122,7 @@
var v = getprop("/controls/nimitz/turn-to-base-course");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Nimitz")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Nimitz")
{
c.getNode("controls/turn-to-base-course").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);

View file

@ -62,7 +62,7 @@
var v = getprop("/controls/sanantonio/turn-to-launch-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "San Antonio")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "San Antonio")
{
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
@ -92,7 +92,7 @@
var v = getprop("/controls/sanantonio/turn-to-recovery-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "San Antonio")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "San Antonio")
{
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
@ -122,7 +122,7 @@
var v = getprop("/controls/sanantonio/turn-to-base-course");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "San Antonio")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "San Antonio")
{
c.getNode("controls/turn-to-base-course").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);

View file

@ -62,7 +62,7 @@
var v = getprop("/controls/truman/turn-to-launch-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Truman")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Truman")
{
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
@ -92,7 +92,7 @@
var v = getprop("/controls/truman/turn-to-recovery-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Truman")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Truman")
{
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
@ -121,7 +121,7 @@
var v = getprop("/controls/truman/turn-to-base-course");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Truman")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Truman")
{
c.getNode("controls/turn-to-base-course").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);

View file

@ -62,7 +62,7 @@
var v = getprop("/controls/vinson/turn-to-launch-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Vinson")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Vinson")
{
c.getNode("controls/turn-to-launch-hdg").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);
@ -92,7 +92,7 @@
var v = getprop("/controls/vinson/turn-to-recovery-hdg");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Vinson")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Vinson")
{
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(v);
c.getNode("controls/turn-to-launch-hdg").setBoolValue(0);
@ -122,7 +122,7 @@
var v = getprop("/controls/vinson/turn-to-base-course");
foreach (var c; props.globals.getNode("/ai/models").getChildren("carrier")){
if (c.getNode("name").getValue() == "Vinson")
if (c.getNode("name").getValue() != nil and c.getNode("name").getValue() == "Vinson")
{
c.getNode("controls/turn-to-base-course").setBoolValue(v);
c.getNode("controls/turn-to-recovery-hdg").setBoolValue(0);