- Timestamp:
- Dec 10, 2008, 3:37:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/gametypes/Gametype.cc
r2361 r2369 169 169 for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 170 170 { 171 if (!it->first->getControllableEntity() && (!it->first->isReadyToSpawn() || !this->bStarted_)) 172 { 173 SpawnPoint* spawn = this->getBestSpawnPoint(it->first); 174 if (spawn) 175 { 176 // force spawn at spawnpoint with default pawn 177 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn); 178 spawn->spawn(entity); 179 it->first->startControl(entity); 180 it->second = PlayerState::Dead; 181 } 182 else 183 { 184 COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl; 185 abort(); 171 if (!it->first->getControllableEntity()) 172 { 173 it->second = PlayerState::Dead; 174 175 if (!it->first->isReadyToSpawn() || !this->bStarted_) 176 { 177 SpawnPoint* spawn = this->getBestSpawnPoint(it->first); 178 if (spawn) 179 { 180 // force spawn at spawnpoint with default pawn 181 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(spawn); 182 spawn->spawn(entity); 183 it->first->startControl(entity); 184 it->second = PlayerState::Dead; 185 } 186 else 187 { 188 COUT(1) << "Error: No SpawnPoints in current Gametype" << std::endl; 189 abort(); 190 } 186 191 } 187 192 } … … 211 216 { 212 217 bool allplayersready = true; 218 bool hashumanplayers = false; 213 219 for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it) 214 220 { 215 221 if (!it->first->isReadyToSpawn()) 216 222 allplayersready = false; 217 } 218 if (allplayersready) 223 if (it->first->isHumanPlayer()) 224 hashumanplayers = true; 225 } 226 if (allplayersready && hashumanplayers) 219 227 { 220 228 this->startCountdown_ = this->initialStartCountdown_;
Note: See TracChangeset
for help on using the changeset viewer.