Skip to content

Instantly share code, notes, and snippets.

@legumbre
Created October 26, 2011 04:19
Show Gist options
  • Select an option

  • Save legumbre/1315418 to your computer and use it in GitHub Desktop.

Select an option

Save legumbre/1315418 to your computer and use it in GitHub Desktop.
function Ring:disconnect_ring(other_ring)
local mapEntry= self.other_rings[other_ring]
local tangent= mapEntry.tangent
klog.debug("DISCONNECTING %s(%s) -> %s(%s) ", self.id, tostring(self), other_ring.id, tostring(other_ring), tostring(mapEntry.tangent))
if not mapEntry then
log.warning("Trying to disconnect %d from %d but no previous connection existed", self.id, other_ring.id)
end
self.other_rings[other_ring]= nil -- other_ring is not mapped anymore
tangent.other_ring=NULL
-- tangent.next_ring_distance_cw=100000
-- tangent.next_ring_distance_ccw=100000
-- we need to recalc the tangent distances now that we've
-- disconnected the ring (some tangents are not there anymore)
other_ring:calc_tangent_distances()
-- BBB other info we want to delete?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment