-
May 19th, 2019, 03:54 #1
Any implicit action on returning true/false/nil?
My expectation is that it does nothing, but figured I'd ask in case my mind is about to be blown
When a method (addTraitDB) is called where the return value is not explicitly checked, like so:
Code:for _,v in pairs(DB.getChildren(nodeSource, "traits")) do addTraitDB(nodeChar, "reference_racialtrait", v.getPath()); end
In the current implementation, there are returns each of:
return;
return false;
(and the final all went well until the end
return true;
Is this is just "habit" and/or "in case in future" type coding?Last edited by Varsuuk; May 19th, 2019 at 04:26.
-
May 19th, 2019, 08:12 #2
Nothing happens implicitly. You would need to explicitly check returned value and do something according to it.
"Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness
Post your SavageWorlds ruleset feature requests and issue reports here!
-
May 19th, 2019, 17:40 #3
Ok, then they just return the true/false nil values for chuckles I’ll edit my version of the method to not return anything since I do not yet have a reason to check the result either.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks