lua: allow functions to be called without giving all of its args (#2744)
This makes usage of native functions that normally use pointer args easier to deal with.
This commit is contained in:
parent
683d6bce07
commit
2d55470e10
@ -61,8 +61,7 @@
|
||||
#include "services/notifications/notification_service.hpp"
|
||||
#include "services/translation_service/translation_service.hpp"
|
||||
|
||||
#define SOL_ALL_SAFETIES_ON 1
|
||||
#include "lua/sol.hpp"
|
||||
#include "lua/sol_include.hpp"
|
||||
|
||||
#include <script/types.hpp>
|
||||
|
||||
|
20
src/lua/sol_include.hpp
Normal file
20
src/lua/sol_include.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#define SOL_SAFE_USERTYPE 1
|
||||
#define SOL_SAFE_REFERENCES 1
|
||||
#define SOL_SAFE_FUNCTION 1
|
||||
#define SOL_SAFE_NUMERICS 1
|
||||
#define SOL_SAFE_GETTER 1
|
||||
#define SOL_NO_CHECK_NUMBER_PRECISION 1
|
||||
|
||||
// This is intended to be disabled.
|
||||
// Allow functions to be called without giving all of its args.
|
||||
// Enabling it would make current usage of native functions like
|
||||
// local r, g, b = VEHICLE.GET_VEHICLE_COLOR(spawnedVehicle)
|
||||
// much more annoying due to how pointer args are handled,
|
||||
// there is no way to know unless by hardcoding manually all of them that
|
||||
// a pointer arg is an in or out parameter.
|
||||
//
|
||||
// #define SOL_SAFE_FUNCTION_CALLS
|
||||
|
||||
#include "lua/sol.hpp"
|
Reference in New Issue
Block a user