Functions from the auxiliary library, assume the stack has always at least 5 empty slots, add macro ensure_luaL_stack to wrap every such call so that the stack is checked for enough free space beforehand. This will make mandatory to use the latest version of visual studio 2017 as minimum for windows (it was already being required for c++17 support regardless), as it needs the conformant c++ preprocessor option to be used.
LUA_FUNCTIONs don't really need to check the amount of parameters to be at least 1, as that's implicitly checked by the mandatory first parameter being the lua_object itself
Update lua functions to already have the pduel parameter passed inside them, thus not needing to manually retrieve them in the functions.
Add also a yieldk macro that does the same thing but for the yield continuation function, removing the redoundancies
Most of the library functions are used as "class member functions" where the first parameter is always the corresponding lua object, update the LUA_FUNCTION macro so that the functions already have a "self" parameter corresponding to the already parsed lua object.
Added a new LUA_STATIC_FUNCTION macro for functions that are to be called without an associated object
In loops don't reevaluate it each iteration, in some functions already checking the value before entering a specific codepath don't repeat the same check
Use the new function that return "0" if the object is not a function so that the functions can automatically take advantage of the change in check_matching that skips the second type check each function call.
Update Effect.SetCountLimit to allow passing a table containing id and hopt index as 3rd parameter, used for when cards have multiple hopt effects that can be acivated.
Also updated Effect.GetCountLimit to reflect this change
Currently the core just deallocated the internal object without doing nothing lua side, thus allowing the api to access invalid memory locations previously pointed by referenced objects. Added dummy `deleted` object that will take the place of any deleted lua/c object, raising errors when the api tries to read a lua_obj from the lua stack, so that the address pointed by the lua object will always be valid.
Also fixed possible crash when the label object passed to an EFFECT_TYPE_GRANT effect wasn't a valid effect.