Skip to content

Commit

Permalink
Lua: Add support for System.Double
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 25, 2024
1 parent 7eca5e0 commit 929b0eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mods/bindings/Sdk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,10 @@ sol::object parse_data(lua_State* l, void* data, ::sdk::RETypeDefinition* data_t
return sol::make_object(l, ret_val_f);
}
}
case "System.Double"_fnv: {
auto ret_val_d = *(double*)data;
return sol::make_object(l, ret_val_d);
}
case "System.Boolean"_fnv: {
auto ret_val_b = *(bool*)data;
return sol::make_object(l, ret_val_b);
Expand Down Expand Up @@ -929,6 +933,9 @@ void set_data(void* data, ::sdk::RETypeDefinition* data_type, sol::object& value
case "System.Single"_fnv:
*(float*)data = value.as<float>();
return;
case "System.Double"_fnv:
*(double*)data = value.as<double>();
return;
case "System.Boolean"_fnv:
*(bool*)data = value.as<bool>();
return;
Expand Down

0 comments on commit 929b0eb

Please sign in to comment.