Skip to content

Commit

Permalink
Use standard deprecation mechanism for helper.distance_between
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed May 22, 2017
1 parent c0f926e commit 8492e8d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions data/lua/helper.lua
Expand Up @@ -164,12 +164,6 @@ function helper.get_user_choice(attr, options)
return result
end

--! Returns the distance between two tiles given by their WML coordinates.
function helper.distance_between(...)
wesnoth.log("warn", "helper.distance_between is deprecated; use wesnoth.map.distance_between instead")
return wesnoth.map.distance_between(...)
end

local adjacent_offset = {
[false] = { {0,-1}, {1,-1}, {1,0}, {0,1}, {-1,0}, {-1,-1} },
[true] = { {0,-1}, {1,0}, {1,1}, {0,1}, {-1,1}, {-1,0} }
Expand Down Expand Up @@ -317,6 +311,9 @@ end

-- Compatibility and deprecations

helper.distance_between = helper.deprecate(
"helper.distance_between is deprecated; use wesnoth.map.distance_between instead",
wesnoth.map.distance_between)
helper.get_child = helper.deprecate(
"helper.get_child is deprecated; use wml.get_child instead", wml.get_child)
helper.get_nth_child = helper.deprecate(
Expand Down

0 comments on commit 8492e8d

Please sign in to comment.