cLuaState: Fixed errors on non-existent callbacks.
This mostly affected table-based callbacks, such as the cLineBlockTracer. If a callback didn't exist, the code would still push its arguments on the stack, breaking the next callback.
This commit is contained in:
parent
e2ffd5429c
commit
2b7f34515a
@ -247,7 +247,11 @@ public:
|
|||||||
template <typename FnT, typename... Args>
|
template <typename FnT, typename... Args>
|
||||||
bool Call(const FnT & a_Function, Args &&... args)
|
bool Call(const FnT & a_Function, Args &&... args)
|
||||||
{
|
{
|
||||||
PushFunction(a_Function);
|
if (!PushFunction(a_Function))
|
||||||
|
{
|
||||||
|
// Pushing the function failed
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return PushCallPop(args...);
|
return PushCallPop(args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user