modules/world: only attach view to camera if one is requested

This commit is contained in:
Kazhnuz 2019-04-29 08:45:48 +02:00
parent 9c3ef4ce65
commit 79ecdc822b

View file

@ -83,15 +83,19 @@ function CameraSystem:getViewCam(id)
end end
function CameraSystem:attachView(id) function CameraSystem:attachView(id)
if (id ~= nil) then
local cam = self:getViewCam(id) local cam = self:getViewCam(id)
cam:attach() cam:attach()
end
end end
function CameraSystem:detachView(id) function CameraSystem:detachView(id)
if (id ~= nil) then
local cam = self:getViewCam(id) local cam = self:getViewCam(id)
cam:detach() cam:detach()
end
end end
return CameraSystem return CameraSystem