[Commits] [wesnoth/wesnoth] e3c249: Fix Lua error when WML assigns a real number to an...

GitHub noreply at github.com
Sat Oct 29 03:59:38 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: e3c249fd88f7509a9465bc231ca783beb6d56b1a
      https://github.com/wesnoth/wesnoth/commit/e3c249fd88f7509a9465bc231ca783beb6d56b1a
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-10-29 (Sat, 29 Oct 2016)

  Changed paths:
    M src/scripting/lua_common.hpp

  Log Message:
  -----------
  Fix Lua error when WML assigns a real number to an integer attribute

This regressed in the Lua 5.3 upgrade. LuaL_checkinteger() started to give
an error when the variable isn't an integer. In Lua 5.2 it truncated the
variable instead.

Fortunately we have a macro for modifying attributes, and thus I can fix
all the errors at once.

Maybe a version of the macro that gives an error when the attribute isn't
an integer would be useful as well.





More information about the Commits mailing list