Skip to content

Commit

Permalink
Fixup 13cacd1 (use luaL_checkinteger over luaL_checknumber)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Feb 3, 2018
1 parent 40da35d commit 7c49995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripting/lua_unit.cpp
Expand Up @@ -453,9 +453,9 @@ static int impl_unit_set(lua_State *L)
map_location dst = src;

if(is_key_x) {
dst.set_wml_x(static_cast<int>(luaL_checknumber(L, 3)));
dst.set_wml_x(static_cast<int>(luaL_checkinteger(L, 3)));
} else {
dst.set_wml_y(static_cast<int>(luaL_checknumber(L, 3)));
dst.set_wml_y(static_cast<int>(luaL_checkinteger(L, 3)));
}

// TODO: could probably be relegated to a helper function.
Expand Down

1 comment on commit 7c49995

@jyrkive
Copy link
Member

@jyrkive jyrkive commented on 7c49995 Feb 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need the static_cast?

Please sign in to comment.