[Commits] [wesnoth/wesnoth] a6bbcf: Address feedback

GitHub noreply at github.com
Sat Sep 17 07:59:34 UTC 2016


  Branch: refs/heads/expose-preferences-to-lua
  Home:   https://github.com/wesnoth/wesnoth
  Commit: a6bbcfb2b5e2c87e1ad20798a77e4c991754a33c
      https://github.com/wesnoth/wesnoth/commit/a6bbcfb2b5e2c87e1ad20798a77e4c991754a33c
  Author: Jyrki Vesterinen <sandgtx at gmail.com>
  Date:   2016-09-17 (Sat, 17 Sep 2016)

  Changed paths:
    M src/preferences.cpp
    M src/preferences.hpp
    M src/scripting/lua_preferences.cpp

  Log Message:
  -----------
  Address feedback

* Changed the plugin preference API to use luaW_pushscalar() and
luaW_toscalar() to handle preference values.
* Set the __metatable field in the "preferences" metatable, which blocks
Lua code from changing the metatable. @celticminstrel suggested setting the
field to a string, but I set it to a boolean instead. According to Lua
reference manual, __metatable prevents the metatable from being changed as
long as it's set, i.e. not nil.





More information about the Commits mailing list