maybe fix the sumo achievement issue

This commit is contained in:
MisterE 2024-12-28 13:33:16 -05:00
parent 014568a7a5
commit 6e832f4f65
2 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,7 @@ core.register_craftitem("sumo:pushstick", {
-- achievment tracking
if arena_lib.is_player_playing(pointed_name, "sumo") then
local arena = arena_lib.get_arena_by_player(pointed_name)
arena.players[pointed_name].last_punched = {type = "swap",time = sumo.get_s_time(), hitter = p_name}
arena.players[pointed_name].last_punched = {punch_type = "swap",time = sumo.get_s_time(), hitter = p_name}
end
end
else --not pressing shift, add velocity "force"
@ -123,7 +123,7 @@ core.register_craftitem("sumo:pushstick", {
-- achievment tracking
if arena_lib.is_player_playing(pointed_name, "sumo") then
local arena = arena_lib.get_arena_by_player(pointed_name)
arena.players[pointed_name].last_punched = {type = "punch", time = sumo.get_s_time(), hitter = p_name}
arena.players[pointed_name].last_punched = {punch_type = "punch", time = sumo.get_s_time(), hitter = p_name}
end
end

View File

@ -204,11 +204,11 @@ function sumo.kill_player(arena,pl_name)
if arena.players[pl_name].last_punched and sumo.get_s_time() - arena.players[pl_name].last_punched.time < 5 then
if sumo.debug then
core.chat_send_all("punch time: "..sumo.get_s_time() - arena.players[pl_name].last_punched.time)
core.chat_send_all("punch type: "..arena.players[pl_name].last_punched.type)
core.chat_send_all("punch type: "..arena.players[pl_name].last_punched.punch_type)
core.chat_send_all("punch name: "..arena.players[pl_name].last_punched.hitter)
end
xc_name = arena.players[pl_name].last_punched.hitter
local punch_type = arena.players[pl_name].last_punched.type
local punch_type = arena.players[pl_name].last_punched.punch_type
table.insert(arena.players[pl_name].kill_log, 1, {killer = xc_name, punch_type = punch_type})
else
table.insert(arena.players[pl_name].kill_log, 1, {killer = nil, punch_type = "fall"})
@ -374,7 +374,7 @@ arena_lib.on_eliminate('sumo', function(arena, p_name, xc_name, player_propertie
if player_properties.kill_log and
player_properties.kill_log[1] and
player_properties.kill_log[1].killer and
player_properties.kill_log[1].type == "swap" then
player_properties.kill_log[1].punch_type == "swap" then
sumo.award(player_properties.kill_log[1].killer, "sumo:reversi")
end