KnightHawk75 -> [Logged] SideWrapper unitsBy intereting case of exception. (6/13/2021 3:42:19 PM)
So I came across this interesting thing.
1. Restart CMO.
2. Load the attached scene in the editor.
3. Press the special action with "FreshStart" in the name.
4. Note the invalid parameters to method exception. for feeding nil as a category in the filter.
5. Press the second special action with "NonNil" in the name.
6. Note it runs.
7. Press the special action with "FreshStart" in the name.
8. Note it now runs fine with no exception.
9. reload map and repeat for same results still works.
10. exit to main menu and reenter editor and repeat (same result still works.)
11. Restart CMO a second time.
12. repeat the step BUT this time run "NonNil" first, and then "FreshStart". - NO exceptions.
If you run same test excluding the additional params (so defaults get used) in an attempt to test 'initializing' it. ie s:unitsBy("Facility"); that will not clear the way for #3 above to run.
Weird huh. [&:] It's more curious to me why nil works after than why nil fails initially.
Even more weird cause I can see the function has a default in it's definition of 0 so I'm not sure what exactly is going on other than something buried deep in translation layer before it even gets there.
-- B1147.25 -- Invalid arguments to method: LuaWrapper_Side.unitsBy
Exception: Invalid arguments to method: LuaWrapper_Side.unitsBy
Stack Trace: at NLua.Lua.ThrowExceptionFromError(Int32 oldTop)
at NLua.Lua.DoString(String chunk, String chunkName)
at Command_Core.Lua.LuaSandBox.RunScript(String str, Boolean RunInteractively, String script)
at Command_Core.SpecialAction.(Scenario )
Call Stack & Error details:
Error at 101325,
...and no I'm not trying to find these things, just come across them, this one was from a "why is something that worked for a an entire day flawlessly suddenly not working on restart" incident. :)