Skip to content

Commit

Permalink
Fix crash when copy-pasting spidertron configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tburrows13 committed Jan 24, 2025
1 parent c1b83c9 commit 741fcdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/spidertron-control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ local function on_entity_settings_pasted(event)
local patrol_data = util.table.deepcopy(get_patrol_data(source))
patrol_data.spidertron = destination
patrol_data.on_patrol = table.deepcopy(destination_waypoint_info.on_patrol)
patrol_data.on_patrol.at_waypoint = nil
if patrol_data.on_patrol then
patrol_data.on_patrol.at_waypoint = nil
end

-- Erase all render objects so that new ones can be recreated by WaypointRendering.update_render_text
for _, waypoint in pairs(patrol_data.waypoints) do
Expand Down

0 comments on commit 741fcdc

Please # to comment.