Changeset 6920 for code/branches/presentation3
- Timestamp:
- May 17, 2010, 4:57:26 PM (14 years ago)
- Location:
- code/branches/presentation3
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/orxonox/gametypes/TeamDeathmatch.cc
r6417 r6920 137 137 } 138 138 139 SpawnPoint* fallbackSpawnPoint = NULL; 140 139 141 if (teamSpawnPoints.size() > 0) 140 142 { … … 144 146 { 145 147 if (index == randomspawn) 148 { 149 fallbackSpawnPoint = (*it); 150 break; 151 } 152 153 ++index; 154 } 155 156 for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ) 157 { 158 if (!(*it)->isActive()) 159 { 160 COUT(1) << "MUP" << std::endl; 161 teamSpawnPoints.erase(it++); 162 continue; 163 } 164 165 ++it; 166 } 167 168 randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size()))); 169 index = 0; 170 for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it) 171 { 172 if (index == randomspawn) 146 173 return (*it); 147 174 148 175 ++index; 149 176 } 177 178 return fallbackSpawnPoint; 150 179 } 151 180
Note: See TracChangeset
for help on using the changeset viewer.