Skip to content

Commit

Permalink
Fix crash when command (not from SP) completes while on_patrol = true
Browse files Browse the repository at this point in the history
  • Loading branch information
tburrows13 committed Dec 16, 2024
1 parent 8af5c15 commit 48c61df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/spidertron-control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ local function on_spider_command_completed(event)
if waypoint_info.on_patrol then
local waypoints = waypoint_info.waypoints
local waypoint = waypoints[waypoint_info.current_index]
if not waypoint then
-- Command was not issued by Spidertron Patrols, so disable patrol mode
PatrolGui.set_on_patrol(false, spidertron, waypoint_info)
return
end
local waypoint_type = waypoint.type

script.raise_event("on_spidertron_patrol_waypoint_reached", {
Expand Down

0 comments on commit 48c61df

Please sign in to comment.