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
function CameraSystem:attachView(id)
local cam = self:getViewCam(id)
if (id ~= nil) then
local cam = self:getViewCam(id)
cam:attach()
cam:attach()
end
end
function CameraSystem:detachView(id)
local cam = self:getViewCam(id)
if (id ~= nil) then
local cam = self:getViewCam(id)
cam:detach()
cam:detach()
end
end
return CameraSystem