Skip to content

Commit

Permalink
last chance changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Treer committed Feb 11, 2020
1 parent 523f4d5 commit 73ac96b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions portal_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,8 @@ end
-- portal_name is optional, providing it allows existing portals on the surface to be reused.
function nether.find_surface_target_y(target_x, target_z, portal_name)

assert(target_x ~= nil and target_z ~= nil, "Arguments `target_x` and `target_z` cannot be nil when calling find_surface_target_y()")

-- default to starting the search at -16 (probably underground) if we don't know the
-- surface, like paramat's original code from before get_spawn_level() was available:
-- https://github.com/minetest-mods/nether/issues/5#issuecomment-506983676
Expand Down Expand Up @@ -2226,6 +2228,7 @@ function nether.find_nearest_working_portal(portal_name, anchorPos, distance_lim

local portal_definition = nether.registered_portals[portal_name]
assert(portal_definition ~= nil, "find_nearest_working_portal() called with portal_name '" .. portal_name .. "', but no portal is registered with that name.")
assert(anchorPos ~= nil, "Argument `anchorPos` cannot be nil when calling find_nearest_working_portal()")

local contenders = list_closest_portals(portal_definition, anchorPos, distance_limit, y_factor)

Expand Down

0 comments on commit 73ac96b

Please sign in to comment.