From 1fd5502e9b61aaff1b25e375123c0a2c0ea77ea4 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 4 Sep 2020 10:56:18 +0100 Subject: [PATCH] Nasal removecommand: use a return value Change removecommand() to indicate success or failure via a return value: 1 for success, 0 for failure. --- src/Scripting/NasalSys.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 5af03c492..b6eb6f7f5 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -838,9 +838,9 @@ static naRef f_removeCommand(naContext c, naRef me, int argc, naRef* args) const string commandName(naStr_data(args[0])); bool ok = nasalSys->removeCommand(commandName); if (!ok) { - naRuntimeError(c, "Failed to remove command:%s", commandName.c_str()); + return naNum(0); } - return naNil(); + return naNum(1); } static naRef f_open(naContext c, naRef me, int argc, naRef* args)