diff --git a/gamecore/modules/world/baseworld.lua b/gamecore/modules/world/baseworld.lua index 108e63e..43f9b51 100644 --- a/gamecore/modules/world/baseworld.lua +++ b/gamecore/modules/world/baseworld.lua @@ -144,6 +144,11 @@ end function BaseWorld:initPlayers() self.players = {} + self.playerNumber = 1 +end + +function BaseWorld:setPlayerNumber(playerNumber) + self.playerNumber = playerNumber or 1 end function BaseWorld:addPlayer(actor, sourceid, haveCam) @@ -214,8 +219,10 @@ function BaseWorld:loadMapPlayers() print("DEBUG: loading actors in player layer") local i = 1 for k, object in pairs(objectlayer.objects) do - self:addPlayer(self.obj.Player(self, object.x, object.y), i, true) + if (i <= self.playerNumber) then -- TODO: don't hardcode camera handling + self:addPlayer(self.obj.Player(self, object.x, object.y), i, true) + end i = i + 1 end self.map:removeLayer(objectlayer.name)