Skip to content

Commit 5e95bbd

Browse files
committed
Update camera.lua
1 parent f8de061 commit 5e95bbd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

orthographic/camera.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ end
218218
-- @param camera_id
219219
function M.final(camera_id)
220220
assert(camera_id, "You must provide a camera id")
221-
cameras[camera_id] = nil
221+
-- check that a new camera with the same id but from a different go hasn't been
222+
-- replacing the camera that is being unregistered
223+
-- if this is the case we simply ignore the call to final()
224+
if cameras[camera_id].url ~= msg.url() then
225+
cameras[camera_id] = nil
226+
end
222227
end
223228

224229
--- Update a camera

0 commit comments

Comments
 (0)