1
0
Fork 0

Increase severity of warning when trying to add a setlistener onto a tied property

- before this it was all to easy to miss being at DEBUG level and this is quite an important problem to be aware of for model developers
This commit is contained in:
Richard Harrison 2019-05-29 20:25:28 +02:00
parent 4f4166e540
commit 8c4334e3ae

View file

@ -1534,7 +1534,7 @@ naRef FGNasalSys::setListener(naContext c, int argc, naRef* args)
}
if(node->isTied())
SG_LOG(SG_NASAL, SG_DEBUG, "Attaching listener to tied property " <<
SG_LOG(SG_NASAL, SG_DEV_ALERT, "ERROR: Cannot add listener to tied property " <<
node->getPath());
naRef code = argc > 1 ? args[1] : naNil();
@ -1543,8 +1543,8 @@ naRef FGNasalSys::setListener(naContext c, int argc, naRef* args)
return naNil();
}
int init = argc > 2 && naIsNum(args[2]) ? int(args[2].num) : 0;
int type = argc > 3 && naIsNum(args[3]) ? int(args[3].num) : 1;
int init = argc > 2 && naIsNum(args[2]) ? int(args[2].num) : 0; // do not trigger when created
int type = argc > 3 && naIsNum(args[3]) ? int(args[3].num) : 1; // trigger will always be triggered when the property is written
FGNasalListener *nl = new FGNasalListener(node, code, this,
gcSave(code), _listenerId, init, type);