return;
}
- _command = globals->get_commands()->getCommand(_command_name);
- if (_command == 0) {
- SG_LOG(SG_INPUT, SG_ALERT, "Command " << _command_name << " is undefined");
- _arg = 0;
- return;
- }
-
delete _arg;
_arg = new SGPropertyNode;
_setting = 0;
FGBinding::fire () const
{
if (test()) {
+ if (_command == 0)
+ _command = globals->get_commands()->getCommand(_command_name);
if (_command == 0) {
SG_LOG(SG_INPUT, SG_WARN, "No command attached to binding");
} else if (!(*_command)(_arg)) {
// just to be safe.
FGBinding (const FGBinding &binding);
-
string _command_name;
- SGCommandMgr::command_t _command;
+ mutable SGCommandMgr::command_t _command;
mutable SGPropertyNode * _arg;
mutable SGPropertyNode_ptr _setting;
};