1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Modernize lua read (part 1): C++ templating insurance (#7394)

* Modernize lua read (part 1): C++ templating assurance

Implement the float reader
This commit is contained in:
Loïc Blot 2018-06-04 22:38:07 +02:00 committed by GitHub
parent 86b19f2849
commit 180e551c56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 21 deletions

View file

@ -190,7 +190,7 @@ int MetaDataRef::l_set_float(lua_State *L)
MetaDataRef *ref = checkobject(L, 1);
std::string name = luaL_checkstring(L, 2);
float a = luaL_checknumber(L, 3);
float a = readParam<float>(L, 3);
std::string str = ftos(a);
Metadata *meta = ref->getmeta(true);