if(players[whichPlayer].m_ships[j].m_orientation == VERTICAL) { for(int k = 0; k < shipSize[j]; k++) { players[whichPlayer].m_gameGrid[0][location.m_row + k][location.m_col] = (Ship)j; } } else { for(int k = 0; k < shipSize[j]; k++) { players[whichPlayer].m_gameGrid[0][location.m_row][location.m_col + k] = (Ship)j; } }