[wesnoth-commits] [wesnoth/wesnoth] b075bb: Fix some typos

Celtic Minstrel noreply at github.com
Thu Mar 4 19:01:14 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b075bbf0c157f363e2cf28581bf0c8266fc8cce8
      https://github.com/wesnoth/wesnoth/commit/b075bbf0c157f363e2cf28581bf0c8266fc8cce8
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M src/scripting/lua_terrainfilter.cpp
    M src/scripting/lua_terrainfilter.hpp
    M src/scripting/lua_terrainmap.cpp
    M src/scripting/lua_terrainmap.hpp
    M src/scripting/mapgen_lua_kernel.cpp

  Log Message:
  -----------
  Fix some typos


  Commit: dacd5b323e392394f3210086e41c5c63ad1140d0
      https://github.com/wesnoth/wesnoth/commit/dacd5b323e392394f3210086e41c5c63ad1140d0
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    A data/lua/core/map.lua

  Log Message:
  -----------
  Add some utility functions to help clarify the merge mode being used when assigning terrains


  Commit: 51cf2621f776c1b484ec6bafad252594b630c2bd
      https://github.com/wesnoth/wesnoth/commit/51cf2621f776c1b484ec6bafad252594b630c2bd
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua
    M data/lua/location_set.lua

  Log Message:
  -----------
  Add a utility function to extract a location from the front of a variadic parameter pack

The purpose of this is to make it easy for functions implemented in Lua to handle locations
in the same way as functions implemented in C++.

The location_set module has been updated to make use of this functionality in its setter functions.

Usage example:

Imagine a function foo with the following signature:

foo(bar : string, home : location, mode : string, target : location, moo : boolean) -> boolean

With the new read_location function it could be implemented as follows:

function foo(...)
	-- First argument goes in bar
	local bar = ...
	-- Read location starting at the second argument
	local home, n = wesnoth.mP.read_location(select(2, ...))
	-- note: n will be 0 if a location wasn't found at that position
	-- This could be an error, or it could be handled as an optional parameter
	-- Next argument after that goes in mode
	local mode = select(n + 2, ...)
	-- Then read a location into target
	local target, m = wesnoth.map.read_location(select(n + 2, ...))
	-- Finally, read a parameter into moo
	local moo = select(m + n + 2, ...)
	-- Do stuff with all these parameters
	return true
end

With that code, all the following invocations of foo work:

foo('a', 'b', true) -- both optional locations omitted
foo('a', 1, 2, 'q', 5, 6, false) -- locations given as separate integer parameters
foo('a', 'm', {1, 7},  true) -- first location omitted, second given as 2-element array
foo('a', some_unit, 'z', {x = 5, y = 10}, false) -- a unit also functions as a location
foo('a', 7, 12, 'q', my_leader, true) -- mixing different forms also works


  Commit: e6efc7de6c833c10e95beb71836d2b865ffc3feb
      https://github.com/wesnoth/wesnoth/commit/e6efc7de6c833c10e95beb71836d2b865ffc3feb
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua
    M src/editor/action/action.cpp
    M src/editor/action/mouse/mouse_action.cpp
    M src/editor/map/editor_map.cpp
    M src/game_board.cpp
    M src/game_board.hpp
    M src/map/map.cpp
    M src/map/map.hpp
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp
    M src/scripting/lua_terrainfilter.cpp
    M src/scripting/lua_terrainfilter.hpp
    M src/scripting/lua_terrainmap.cpp
    M src/scripting/lua_terrainmap.hpp
    M src/scripting/mapgen_lua_kernel.cpp

  Log Message:
  -----------
  Refactor the game map to permit exposing it to Lua via wesnoth.current.map

The method of accessing terrain on the map has drastically changed.
- wesnoth.get_terrain and wesnoth.set_terrain are both deprecated
- wesnoth.terrain_mask still works but is moved into the wesnoth.map module and now takes the map object as the first parameter
- The map's terrain is now accessed exclusively via indexing on the map object, ie map[{x,y}]
- You set terrain by assigning a terrain code; the position of ^ in the terrain code now determines the merge mode
- The replace_if_failed option is now manifested as a function that converts any terrain code into a special value that, when assigned to a location on the map, uses the replace if failed logic.

The map object has a few attributes in it:
- width and height are the total size, including borders
- playable_width and playable_height are the values returned from wesnoth.get_map_size, which is now deprecated
- border_size is the third value from wesnoth.get_map_size
- data converts the map to a string
- Special locations are now part of the map object. The length operator is deprecated.
- other than that, wesnoth.map is treated as if it were the metatable of the map object


  Commit: 2d5ea6312e996f18b5b89eb9a23ef435a1368e1e
      https://github.com/wesnoth/wesnoth/commit/2d5ea6312e996f18b5b89eb9a23ef435a1368e1e
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp

  Log Message:
  -----------
  Move various functions into the map module


  Commit: 7e1414e249eb74843fdeee7956f72709b5086b9c
      https://github.com/wesnoth/wesnoth/commit/7e1414e249eb74843fdeee7956f72709b5086b9c
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/lua_terrainfilter.cpp
    M src/scripting/lua_terrainmap.cpp
    M src/scripting/lua_terrainmap.hpp
    M src/scripting/mapgen_lua_kernel.cpp

  Log Message:
  -----------
  Rename existing map functions in the map generation kernel


  Commit: 90e6db03306bef2e8554b439432592205c0684a8
      https://github.com/wesnoth/wesnoth/commit/90e6db03306bef2e8554b439432592205c0684a8
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua
    M src/scripting/lua_kernel_base.cpp

  Log Message:
  -----------
  Rename two functions for consistency of terminology


  Commit: f8f49102fa10edd742fcee164e122bdaad4451c5
      https://github.com/wesnoth/wesnoth/commit/f8f49102fa10edd742fcee164e122bdaad4451c5
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp

  Log Message:
  -----------
  Add wesnoth.map.get_label


  Commit: 5a129cb5705c6452c22c50331ce7150be7acda46
      https://github.com/wesnoth/wesnoth/commit/5a129cb5705c6452c22c50331ce7150be7acda46
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M src/scripting/lua_kernel_base.cpp
    M src/scripting/lua_map_location_ops.cpp
    M src/scripting/lua_map_location_ops.hpp

  Log Message:
  -----------
  Add wesnoth.map.get_hexes_in_radius


  Commit: 2054cf4acbeb1dafac7b54de0a5f0c9ab64b62c7
      https://github.com/wesnoth/wesnoth/commit/2054cf4acbeb1dafac7b54de0a5f0c9ab64b62c7
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/lua_terrainmap.cpp
    M src/scripting/lua_terrainmap.hpp

  Log Message:
  -----------
  Add on_board and on_border map methods


  Commit: 9cea078f9ba54d3827dac75685efa970f38c6bdf
      https://github.com/wesnoth/wesnoth/commit/9cea078f9ba54d3827dac75685efa970f38c6bdf
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/lua_terrainmap.cpp
    M src/scripting/lua_terrainmap.hpp

  Log Message:
  -----------
  Implement a map iterator


  Commit: cf71af4e114b6d9689977ad010333e3e83c6407e
      https://github.com/wesnoth/wesnoth/commit/cf71af4e114b6d9689977ad010333e3e83c6407e
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua

  Log Message:
  -----------
  Add a terrain hex reference API

This adds a metatable to all locations returned from wesnoth.map.find.


  Commit: 6558c7981b8917abf906df5d8a48a3d8327f7ee8
      https://github.com/wesnoth/wesnoth/commit/6558c7981b8917abf906df5d8a48a3d8327f7ee8
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/lua/core/map.lua
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp

  Log Message:
  -----------
  Add a wesnoth.terrain_types table


  Commit: 9d3bf196b049293a77680264fab42638ed34c704
      https://github.com/wesnoth/wesnoth/commit/9d3bf196b049293a77680264fab42638ed34c704
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/ca_castle_switch.lua
    M data/ai/lua/ca_grab_villages.lua
    M data/ai/lua/ca_recruit_rushers.lua
    M data/ai/lua/ca_spread_poison.lua
    M data/ai/lua/ca_village_hunt.lua
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/retreat.lua
    M data/ai/micro_ais/cas/ca_assassin_move.lua
    M data/ai/micro_ais/cas/ca_big_animals.lua
    M data/ai/micro_ais/cas/ca_bottleneck_move.lua
    M data/ai/micro_ais/cas/ca_fast_attack_utils.lua
    M data/ai/micro_ais/cas/ca_fast_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_healer_move.lua
    M data/ai/micro_ais/cas/ca_herding_dog_move.lua
    M data/ai/micro_ais/cas/ca_herding_f_herding_area.lua
    M data/ai/micro_ais/cas/ca_herding_herd_sheep.lua
    M data/ai/micro_ais/cas/ca_lurkers.lua
    M data/ai/micro_ais/cas/ca_protect_unit_move.lua
    M data/ai/micro_ais/cas/ca_recruit_random.lua
    M data/ai/micro_ais/cas/ca_stationed_guardian.lua
    M data/ai/micro_ais/cas/ca_wolves_move.lua
    M data/ai/micro_ais/cas/ca_zone_guardian.lua
    M data/campaigns/Descent_Into_Darkness/scenarios/04_Spring_of_Reprisal.cfg
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/Eastern_Invasion/lua/bandits.lua
    M data/campaigns/Heir_To_The_Throne/scenarios/13_The_Dwarven_Doors.cfg
    M data/campaigns/Northern_Rebirth/lua/respawn_utils.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua
    M data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua
    M data/campaigns/The_Hammer_of_Thursagan/scenarios/05_Fear.cfg
    M data/campaigns/Two_Brothers/ai/ca_muff_toras_move.lua
    M data/campaigns/World_Conquest/lua/campaign/autorecall.lua
    M data/campaigns/World_Conquest/lua/campaign/enemy.lua
    M data/campaigns/World_Conquest/lua/campaign/enemy_themed.lua
    M data/campaigns/World_Conquest/lua/game_mechanics/bonus.lua
    M data/campaigns/World_Conquest/lua/game_mechanics/supply.lua
    M data/campaigns/World_Conquest/lua/map/generator/utilities.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/1A_Start.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2A_Springs.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2C_Glaciers.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2D_Provinces.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2E_Paradise.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/3C_Delta.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/3F_Wetland.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/4A_Thermal.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/4B_Volcanic.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/4C_Mines.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6A_Rural.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6B_Maritime.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6C_Industrial.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6D_Feudal.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/engine.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/events.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/noise.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/utilities.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/wild_zones.lua
    M data/campaigns/World_Conquest/lua/map/scenario_utils/bonus_points.lua
    M data/campaigns/World_Conquest/lua/map/wct_map_generator.lua
    M data/campaigns/World_Conquest/lua/optional_mechanics/destruction.lua
    M data/lua/helper.lua
    M data/lua/location_set.lua
    M data/lua/wml-tags.lua
    M data/lua/wml/animate_unit.lua
    M data/lua/wml/find_path.lua
    M data/lua/wml/items.lua
    M data/lua/wml/modify_side.lua
    M data/lua/wml/random_placement.lua
    M data/lua/wml/test_condition.lua
    M data/modifications/pick_advance/main.lua
    M data/multiplayer/scenarios/2p_Dark_Forecast.lua
    M data/scenario-test.cfg
    M src/scripting/lua_terrainmap.cpp

  Log Message:
  -----------
  Update everything to use the new wesnoth.map module

- get_terrain and set_terrain replaced with direct indexing operations
- get_map_size mostly replaced with either the iterator or an on_board call.
  Only a few cases really needed to know the size of the map for some other purpose.
- shroud and fog operations, village owner, time areas, and location filters
- get_terrain_info replaced with terrain_types table
- Map generation functions create_map and create_filter


  Commit: c7b2dcca3f3bdd17cc2ff217e334e9b4f6f67c6d
      https://github.com/wesnoth/wesnoth/commit/c7b2dcca3f3bdd17cc2ff217e334e9b4f6f67c6d
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-02-28 (Sun, 28 Feb 2021)

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

  Log Message:
  -----------
  Oh look, a deprecated thing that was missed sometime in the past


  Commit: 3a7eef03105f8db601fb69f70b1d5781a2e856df
      https://github.com/wesnoth/wesnoth/commit/3a7eef03105f8db601fb69f70b1d5781a2e856df
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-03-04 (Thu, 04 Mar 2021)

  Changed paths:
    M data/ai/lua/ai_helper.lua
    M data/ai/lua/battle_calcs.lua
    M data/ai/lua/ca_castle_switch.lua
    M data/ai/lua/ca_grab_villages.lua
    M data/ai/lua/ca_recruit_rushers.lua
    M data/ai/lua/ca_spread_poison.lua
    M data/ai/lua/ca_village_hunt.lua
    M data/ai/lua/generic_recruit_engine.lua
    M data/ai/lua/retreat.lua
    M data/ai/micro_ais/cas/ca_assassin_move.lua
    M data/ai/micro_ais/cas/ca_big_animals.lua
    M data/ai/micro_ais/cas/ca_bottleneck_move.lua
    M data/ai/micro_ais/cas/ca_fast_attack_utils.lua
    M data/ai/micro_ais/cas/ca_fast_move.lua
    M data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua
    M data/ai/micro_ais/cas/ca_goto.lua
    M data/ai/micro_ais/cas/ca_healer_move.lua
    M data/ai/micro_ais/cas/ca_herding_dog_move.lua
    M data/ai/micro_ais/cas/ca_herding_f_herding_area.lua
    M data/ai/micro_ais/cas/ca_herding_herd_sheep.lua
    M data/ai/micro_ais/cas/ca_lurkers.lua
    M data/ai/micro_ais/cas/ca_protect_unit_move.lua
    M data/ai/micro_ais/cas/ca_recruit_random.lua
    M data/ai/micro_ais/cas/ca_stationed_guardian.lua
    M data/ai/micro_ais/cas/ca_wolves_move.lua
    M data/ai/micro_ais/cas/ca_zone_guardian.lua
    M data/campaigns/Descent_Into_Darkness/scenarios/04_Spring_of_Reprisal.cfg
    M data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua
    M data/campaigns/Eastern_Invasion/lua/bandits.lua
    M data/campaigns/Heir_To_The_Throne/scenarios/13_The_Dwarven_Doors.cfg
    M data/campaigns/Northern_Rebirth/lua/respawn_utils.lua
    M data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua
    M data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua
    M data/campaigns/The_Hammer_of_Thursagan/scenarios/05_Fear.cfg
    M data/campaigns/Two_Brothers/ai/ca_muff_toras_move.lua
    M data/campaigns/World_Conquest/lua/campaign/autorecall.lua
    M data/campaigns/World_Conquest/lua/campaign/enemy.lua
    M data/campaigns/World_Conquest/lua/campaign/enemy_themed.lua
    M data/campaigns/World_Conquest/lua/game_mechanics/bonus.lua
    M data/campaigns/World_Conquest/lua/game_mechanics/supply.lua
    M data/campaigns/World_Conquest/lua/map/generator/utilities.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/1A_Start.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2A_Springs.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2C_Glaciers.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2D_Provinces.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/2E_Paradise.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/3C_Delta.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/3F_Wetland.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/4A_Thermal.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/4B_Volcanic.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/4C_Mines.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6A_Rural.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6B_Maritime.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6C_Industrial.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration/6D_Feudal.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/engine.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/events.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/noise.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/utilities.lua
    M data/campaigns/World_Conquest/lua/map/postgeneration_utils/wild_zones.lua
    M data/campaigns/World_Conquest/lua/map/scenario_utils/bonus_points.lua
    M data/campaigns/World_Conquest/lua/map/wct_map_generator.lua
    M data/campaigns/World_Conquest/lua/optional_mechanics/destruction.lua
    A data/lua/core/map.lua
    M data/lua/helper.lua
    M data/lua/location_set.lua
    M data/lua/wml-tags.lua
    M data/lua/wml/animate_unit.lua
    M data/lua/wml/find_path.lua
    M data/lua/wml/harm_unit.lua
    M data/lua/wml/items.lua
    M data/lua/wml/modify_side.lua
    M data/lua/wml/random_placement.lua
    M data/lua/wml/test_condition.lua
    M data/modifications/pick_advance/main.lua
    M data/multiplayer/scenarios/2p_Dark_Forecast.lua
    M data/scenario-test.cfg
    M src/editor/action/action.cpp
    M src/editor/action/mouse/mouse_action.cpp
    M src/editor/map/editor_map.cpp
    M src/game_board.cpp
    M src/game_board.hpp
    M src/map/map.cpp
    M src/map/map.hpp
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp
    M src/scripting/lua_kernel_base.cpp
    M src/scripting/lua_map_location_ops.cpp
    M src/scripting/lua_map_location_ops.hpp
    M src/scripting/lua_terrainfilter.cpp
    M src/scripting/lua_terrainfilter.hpp
    M src/scripting/lua_terrainmap.cpp
    M src/scripting/lua_terrainmap.hpp
    M src/scripting/mapgen_lua_kernel.cpp

  Log Message:
  -----------
  Merge pull request #4580 from wesnoth/lua_gamemap

Refactor the game map to permit exposing it to Lua


Compare: https://github.com/wesnoth/wesnoth/compare/28ea6e82c6dd...3a7eef03105f



More information about the Commits mailing list