Skip to content

Commit

Permalink
Mtn: fix teleport bug for physical character
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerkiz committed Jan 14, 2025
1 parent af0d9e3 commit 5a961cb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions maps/mountain_fortress_v3/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,9 @@ function Public.on_player_changed_position(event)

if adjusted_zones.reversed then
if position.y < -74 then
player.teleport({ position.x, position.y + 1 }, surface)
if player.character ~= nil then
player.character.teleport({ position.x, position.y + 1 }, surface)
end
player.print(({ 'main.forcefield' }), { r = 0.98, g = 0.66, b = 0.22 })
if player.character then
player.character.health = player.character.health - 5
Expand All @@ -2661,7 +2663,9 @@ function Public.on_player_changed_position(event)
end
else
if position.y >= 74 then
player.teleport({ position.x, position.y - 1 }, surface)
if player.character ~= nil then
player.character.teleport({ position.x, position.y - 1 }, surface)
end
player.print(({ 'main.forcefield' }), { r = 0.98, g = 0.66, b = 0.22 })
if player.character then
player.character.health = player.character.health - 5
Expand Down
6 changes: 6 additions & 0 deletions modules/rpg/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,14 @@ show_cooldown_progressbar =
end

local rpg_t = Public.get_value_from_player(player.index)
if not rpg_t then
return
end

local active_spell = Public.get_spell_by_name(rpg_t, rpg_t.dropdown_select_name)
if not active_spell then
return
end
if event.name ~= active_spell.entityName then
Task.set_timeout_in_ticks(update_rate_progressbar, show_cooldown_progressbar, event)
return
Expand Down

0 comments on commit 5a961cb

Please sign in to comment.