From c58f3e04790acc351c9000e3b7d7b21842b8f76b Mon Sep 17 00:00:00 2001 From: Nicholas Hayashi Date: Mon, 10 Jan 2022 16:22:29 -0500 Subject: [PATCH] fix mob spooder bug --- src/mob.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mob.lua b/src/mob.lua index 7c2c3d4..c2afe23 100644 --- a/src/mob.lua +++ b/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 local from = hex_map_get(game_state.map, mob.hex) 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 rate = (spider_speed * mob.speed - math.abs(to.elevation - from.elevation)) * am.delta_time