Source
Veteran OT User
Hello. I'm trying to add some custom code to a new file custom.cpp with global scope and have it make calls to callLuaField.
I was able to make a new scope called g_custom and #include it in main.cpp, but even if after doing
I still get this error:
Full code:
I was able to make a new scope called g_custom and #include it in main.cpp, but even if after doing
Code:
#include <framework/luaengine/luaobject.h>
Code:
Error (active) E0020 identifier "callLuaField" is undefined otclient C:\Users\Adam\Documents\GitHub\otclient\src\custom.cpp 15
Error (active) E0254 type name is not allowed otclient C:\Users\Adam\Documents\GitHub\otclient\src\custom.cpp 15
Error C3861 'callLuaField': identifier not found otclient C:\Users\Adam\Documents\GitHub\otclient\src\custom.cpp 15
Full code:
Code:
#include <custom.h>
#include <framework/luaengine/luaobject.h>
Custom g_custom;
Custom::Custom()
{
}
bool Custom::onMouseRelease(const Point& mousePos, Fw::MouseButton button)
{
return callLuaField<bool>("onMouseRelease", mousePos, button);
}