mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-21 03:40:57 +00:00
Fix lua integer -> enum conversion for command params
This commit is contained in:
parent
2c58169cbb
commit
e9e28dce19
@ -91,7 +91,7 @@ void Param<std::string>::fromLua(lua_State* L, int index)
|
||||
template<>
|
||||
void Param<app::SpriteSheetType>::fromLua(lua_State* L, int index)
|
||||
{
|
||||
if (lua_isstring(L, index))
|
||||
if (lua_type(L, index) == LUA_TSTRING)
|
||||
fromString(lua_tostring(L, index));
|
||||
else
|
||||
setValue((app::SpriteSheetType)lua_tointeger(L, index));
|
||||
@ -100,7 +100,7 @@ void Param<app::SpriteSheetType>::fromLua(lua_State* L, int index)
|
||||
template<>
|
||||
void Param<app::DocExporter::DataFormat>::fromLua(lua_State* L, int index)
|
||||
{
|
||||
if (lua_isstring(L, index))
|
||||
if (lua_type(L, index) == LUA_TSTRING)
|
||||
fromString(lua_tostring(L, index));
|
||||
else
|
||||
setValue((app::DocExporter::DataFormat)lua_tointeger(L, index));
|
||||
|
Loading…
x
Reference in New Issue
Block a user