From 8fdc1d306f3829074c47e7c9ae8fd99fa665f5c0 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 30 Nov 2020 16:17:59 +0000 Subject: [PATCH] =?UTF-8?q?State-machines:=20don=E2=80=99t=20require=20nam?= =?UTF-8?q?e=20for=20transitions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow anonymous transitions, since the name is purely informational (unlike for states). Sentry-Id: FLIGHTGEAR-9H --- simgear/structure/StateMachine.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simgear/structure/StateMachine.cxx b/simgear/structure/StateMachine.cxx index e29fefb1..13af7d9a 100644 --- a/simgear/structure/StateMachine.cxx +++ b/simgear/structure/StateMachine.cxx @@ -441,7 +441,7 @@ void StateMachine::initFromPlist(SGPropertyNode* desc, SGPropertyNode* root) std::string nm = stateDesc->getStringValue("name"); if (nm.empty()) { - SG_LOG(SG_GENERAL, SG_ALERT, "No name found for state in branch " << path); + SG_LOG(SG_GENERAL, SG_DEV_ALERT, "No name found for state in branch " << path); throw sg_exception("No name element in state"); } @@ -464,8 +464,8 @@ void StateMachine::initFromPlist(SGPropertyNode* desc, SGPropertyNode* root) std::string target_id = tDesc->getStringValue("target"); if (nm.empty()) { - SG_LOG(SG_GENERAL, SG_ALERT, "No name found for transition in branch " << path); - throw sg_exception("No name element in transition"); + SG_LOG(SG_GENERAL, SG_DEV_WARN, "No name found for transition in branch " << path); + nm = "transition-to-" + target_id; } if (target_id.empty()) {