[wesnoth-commits] [wesnoth/wesnoth] 3c63b1: optimize modify_unit

GitHub noreply at github.com
Sat Nov 10 21:33:44 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 3c63b1e6de8ae913f7aa2c6b3d06021f29382787
      https://github.com/wesnoth/wesnoth/commit/3c63b1e6de8ae913f7aa2c6b3d06021f29382787
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-11-10 (Sat, 10 Nov 2018)

  Changed paths:
    M data/lua/wml/modify_unit.lua

  Log Message:
  -----------
  optimize modify_unit

now modify_unit no longer causes the full rebuild of the unit unless it
is really needed, this is not only faster, it also prepares a future
optimisation in reducing the units size in savegame files.


  Commit: 66a282a96be288a284d12a71625868cee5b2dc6b
      https://github.com/wesnoth/wesnoth/commit/66a282a96be288a284d12a71625868cee5b2dc6b
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-11-10 (Sat, 10 Nov 2018)

  Changed paths:
    M src/game_board.cpp
    M src/units/attack_type.cpp
    M src/units/attack_type.hpp
    M src/units/unit.cpp
    M src/units/unit.hpp

  Log Message:
  -----------
  do not write unchanged unit attributes

This should make savefiles smaller. Note that this does not effect all
games since some wml codes will disable this optimisation.


  Commit: 3bfe5c20410caa6856d98047cb483725506f388a
      https://github.com/wesnoth/wesnoth/commit/3bfe5c20410caa6856d98047cb483725506f388a
  Author: gfgtdf <daniel.gfgtdf at gmail.com>
  Date:   2018-11-10 (Sat, 10 Nov 2018)

  Changed paths:
    M src/units/unit.cpp

  Log Message:
  -----------
  fix movement loss after expire_modification

previously when the unit had a movement effect, expire_modifications
could remove movement via the `movement_ = max_movement_;` line in
the movement effect implementation.


Compare: https://github.com/wesnoth/wesnoth/compare/dbaf40239330...3bfe5c20410c
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Commits mailing list