diff --git a/inGameAppState.cpp b/inGameAppState.cpp index ea83225..c9ff629 100755 --- a/inGameAppState.cpp +++ b/inGameAppState.cpp @@ -57,7 +57,7 @@ namespace battleship{ AbstractAppState::onAttached(); Camera *cam = Root::getSingleton()->getCamera(); - cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId - 1) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE); + cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE); cam->lookAt(Vector3(0, -1, -1).norm(), Vector3(0, 1, -1).norm()); mainPlayer = Game::getSingleton()->getPlayer(playerId); diff --git a/map.cpp b/map.cpp index 50c268e..6b9a3c4 100755 --- a/map.cpp +++ b/map.cpp @@ -403,9 +403,8 @@ namespace battleship{ assetManager->load(path + vfxPrefix, true); assetManager->load(path + gameObjPrefix, true); + int numPlayers = Game::getSingleton()->getNumPlayers(); string playerInd = "players"; - SOL_LUA_VIEW.script("numPlayers = #" + mapTable + "." + playerInd); - int numPlayers = SOL_LUA_VIEW["numPlayers"]; for(int i = 0; i < numPlayers; i++){ string resDepInd = "resourceDeposits";