[wesnoth-commits] [wesnoth/wesnoth] d65d12: Big cleanup of get_adjacent_tiles usage

Charles Dang noreply at github.com
Sat Jan 16 09:39:04 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: d65d12e89d59c32700b98dac47eb90083fd59071
      https://github.com/wesnoth/wesnoth/commit/d65d12e89d59c32700b98dac47eb90083fd59071
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2021-01-16 (Sat, 16 Jan 2021)

  Changed paths:
    M src/actions/attack.cpp
    M src/actions/move.cpp
    M src/actions/vision.cpp
    M src/ai/contexts.cpp
    M src/ai/default/aspect_attacks.cpp
    M src/ai/default/attack.cpp
    M src/ai/default/ca.cpp
    M src/ai/default/ca_move_to_targets.cpp
    M src/ai/default/contexts.cpp
    M src/ai/formula/ai.cpp
    M src/ai/formula/callable_objects.cpp
    M src/ai/formula/function_table.cpp
    M src/display.cpp
    M src/display_context.cpp
    M src/editor/action/mouse/mouse_action_item.cpp
    M src/editor/action/mouse/mouse_action_unit.cpp
    M src/editor/map/editor_map.cpp
    M src/formula/function.cpp
    M src/formula/function_gamestate.cpp
    M src/generators/cave_map_generator.cpp
    M src/generators/default_map_generator_job.cpp
    M src/map/location.cpp
    M src/map/location.hpp
    M src/mouse_events.cpp
    M src/pathfind/pathfind.cpp
    M src/pathutils_impl.hpp
    M src/scripting/lua_map_location_ops.cpp
    M src/terrain/filter.cpp
    M src/units/abilities.cpp
    M src/units/filter.cpp
    M src/units/udisplay.cpp

  Log Message:
  -----------
  Big cleanup of get_adjacent_tiles usage

This adds a new overload of get_adjacent_tiles that returns the array instead of taking the address of
the first element (a C paradigm). This also converts the use of the result to range-for loops when possible,
which is enabled b the fact that we're using std::array here instead of C arrays.





More information about the Commits mailing list