diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/game/StarBehaviorState.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/game/StarBehaviorState.cpp')
-rw-r--r-- | source/game/StarBehaviorState.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/game/StarBehaviorState.cpp b/source/game/StarBehaviorState.cpp index 5308f3a..39a800e 100644 --- a/source/game/StarBehaviorState.cpp +++ b/source/game/StarBehaviorState.cpp @@ -67,7 +67,7 @@ LuaTable Blackboard::parameters(StringMap<NodeParameter> const& parameters, uint // dumb special case for allowing a vec2 of blackboard number keys if (p.second.first == NodeParameterType::Vec2) { if (value.type() != Json::Type::Array) - throw StarException(strf("Vec2 parameter not of array type for key %s", p.first, value)); + throw StarException(strf("Vec2 parameter not of array type for key {}", p.first, value)); JsonArray vector = value.toArray(); LuaTable luaVector = m_luaContext.engine().createTable(); for (int i = 0; i < 2; i++) { @@ -210,7 +210,7 @@ NodeStatus BehaviorState::runAction(ActionNode const& node, NodeState& state) { try { result = thread.resume<ActionReturn>(parameters, blackboardPtr(), id, m_lastDt).value(ActionReturn(NodeStatus::Invalid, LuaNil)); } catch (LuaException const& e) { - throw StarException(strf("Lua Exception caught running action node %s in behavior %s: %s", node.name, m_tree->name, outputException(e, false))); + throw StarException(strf("Lua Exception caught running action node {} in behavior {}: {}", node.name, m_tree->name, outputException(e, false))); } auto status = get<0>(result); @@ -222,7 +222,7 @@ NodeStatus BehaviorState::runAction(ActionNode const& node, NodeState& state) { try { result = thread.resume<ActionReturn>(m_lastDt).value(ActionReturn(NodeStatus::Invalid, LuaNil)); } catch (LuaException const& e) { - throw StarException(strf("Lua Exception caught resuming action node %s in behavior %s: %s", node.name, m_tree->name, outputException(e, false))); + throw StarException(strf("Lua Exception caught resuming action node {} in behavior {}: {}", node.name, m_tree->name, outputException(e, false))); } auto status = get<0>(result); @@ -246,7 +246,7 @@ NodeStatus BehaviorState::runDecorator(DecoratorNode const& node, NodeState& sta try { status = thread.resume<NodeStatus>(parameters, blackboardPtr(), id).value(NodeStatus::Invalid); } catch (LuaException const& e) { - throw StarException(strf("Lua Exception caught initializing decorator node %s in behavior %s: %s", node.name, m_tree->name, outputException(e, false))); + throw StarException(strf("Lua Exception caught initializing decorator node {} in behavior {}: {}", node.name, m_tree->name, outputException(e, false))); } if (status == NodeStatus::Success || status == NodeStatus::Failure) return status; @@ -262,7 +262,7 @@ NodeStatus BehaviorState::runDecorator(DecoratorNode const& node, NodeState& sta try { status = decorator.thread.resume<NodeStatus>(childStatus).value(NodeStatus::Invalid); } catch (LuaException const& e) { - throw StarException(strf("Lua Exception caught resuming decorator node %s in behavior %s: %s", node.name, m_tree->name, outputException(e, false))); + throw StarException(strf("Lua Exception caught resuming decorator node {} in behavior {}: {}", node.name, m_tree->name, outputException(e, false))); } } else { return NodeStatus::Running; @@ -287,7 +287,7 @@ NodeStatus BehaviorState::runComposite(CompositeNode const& node, NodeState& sta else if (node.is<RandomizeNode>()) status = runRandomize(node.get<RandomizeNode>(), state); else - throw StarException(strf("Unable to run composite node type with variant type index %s", node.typeIndex())); + throw StarException(strf("Unable to run composite node type with variant type index {}", node.typeIndex())); return status; } |