fix syntax of minetest.after():cancel()

This commit is contained in:
tour 2024-08-10 00:47:26 +02:00
parent c4665b2eb6
commit 67b31d7d6d
2 changed files with 9 additions and 9 deletions

View File

@ -92,7 +92,7 @@ local function remove_announcement(announcement)
hud:hide(player)
end
end
announcement.timeout_job.cancel()
announcement.timeout_job:cancel()
end
@ -113,7 +113,7 @@ local function post_announcement(announcement)
announcement.message .. " " ..
minetest.pos_to_string(rounded_pos)
chat_message = minetest.colorize(announcement.message_color, chat_message)
if type(announcement.message_scope) == "table" then
for _,player_name in ipairs(announcement.message_scope) do

View File

@ -84,7 +84,7 @@ function IconWaypointHUD:new(point_pos, label, label_color, icon, icon_scale, ic
}
self.__index = self
setmetatable(w, self)
w.huddef_label = {
hud_elem_type = "waypoint",
name = label,
@ -107,7 +107,7 @@ function IconWaypointHUD:new(point_pos, label, label_color, icon, icon_scale, ic
--precision = WAYPOINT_PRECISION,
--number = waypoint_color,
}
return w
end
@ -151,7 +151,7 @@ function CompassHUD:new(size, alignment, direction, icon_format, icon_color, qua
alignment = alignment,
dir = 1,
}
return c
end
@ -201,12 +201,12 @@ function WaypointHUD:new(player, point_pos,
text = "waypoint_announce_background.png",
alignment = alignment,
})
w.waypoint_hud = IconWaypointHUD:new(point_pos, label, label_color, point_icon, point_icon_scale, point_color)
local d = vector.subtract(point_pos, player:get_pos())
w.compass_hud = CompassHUD:new(size, alignment, d, arrow_icon_format, arrow_icon_color, quad_steps)
return w
end
@ -223,7 +223,7 @@ function WaypointHUD:hide(player)
self.compass_hud:hide(player)
player:hud_remove(self.background)
if self.auto_update_job then
self.auto_update_job.cancel()
self.auto_update_job:cancel()
self.auto_update_job = nil
end
end