Browse Source

fix mob spooder bug

master
Nicholas Hayashi 3 years ago
parent
commit
c58f3e0479
  1. 4
      src/mob.lua

4
src/mob.lua

@ -269,6 +269,10 @@ local function update_mob_spooder(mob, mob_index)
if mob_can_pass_through(mob, mob.frame_target) then if mob_can_pass_through(mob, mob.frame_target) then
local from = hex_map_get(game_state.map, mob.hex) local from = hex_map_get(game_state.map, mob.hex)
local to = hex_map_get(game_state.map, mob.frame_target) local to = hex_map_get(game_state.map, mob.frame_target)
if not from or not to then
-- @TODO this happens rarely, why? when?
return
end
local spider_speed = ((math.simplex(mob.hex) + 1.5) * 1.5) ^ 2 local spider_speed = ((math.simplex(mob.hex) + 1.5) * 1.5) ^ 2
local rate = (spider_speed * mob.speed - math.abs(to.elevation - from.elevation)) * am.delta_time local rate = (spider_speed * mob.speed - math.abs(to.elevation - from.elevation)) * am.delta_time

Loading…
Cancel
Save