fix(lua): allow natives to be called with nil strings. (#2652)

This commit is contained in:
Quentin
2024-01-17 11:08:35 +01:00
committed by GitHub
parent b7b2017289
commit e005640c75
32 changed files with 1673 additions and 1291 deletions

View File

@ -44,9 +44,9 @@ namespace lua::native
return ropeId;
}
static void LUA_NATIVE_PHYSICS_LOAD_ROPE_DATA(int ropeId, const char* rope_preset)
static void LUA_NATIVE_PHYSICS_LOAD_ROPE_DATA(int ropeId, sol::stack_object rope_preset)
{
PHYSICS::LOAD_ROPE_DATA(ropeId, rope_preset);
PHYSICS::LOAD_ROPE_DATA(ropeId, rope_preset.is<const char*>() ? rope_preset.as<const char*>() : nullptr);
}
static void LUA_NATIVE_PHYSICS_PIN_ROPE_VERTEX(int ropeId, int vertex, float x, float y, float z)