- Timestamp:
- Dec 14, 2008, 8:13:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/objects/gametypes/Gametype.cc
r2438 r2447 149 149 void Gametype::pawnKilled(Pawn* victim, Pawn* killer) 150 150 { 151 if (victim )151 if (victim && victim->getPlayer()) 152 152 { 153 153 std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(victim->getPlayer()); 154 it->second = PlayerState::Dead; 155 156 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator()); 157 if (victim->getCamera()) 158 { 159 entity->setPosition(victim->getCamera()->getWorldPosition()); 160 entity->setOrientation(victim->getCamera()->getWorldOrientation()); 154 if (it != this->players_.end()) 155 { 156 it->second = PlayerState::Dead; 157 158 ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator()); 159 if (victim->getCamera()) 160 { 161 entity->setPosition(victim->getCamera()->getWorldPosition()); 162 entity->setOrientation(victim->getCamera()->getWorldOrientation()); 163 } 164 else 165 { 166 entity->setPosition(victim->getWorldPosition()); 167 entity->setOrientation(victim->getWorldOrientation()); 168 } 169 it->first->startControl(entity); 161 170 } 162 171 else 163 { 164 entity->setPosition(victim->getWorldPosition()); 165 entity->setOrientation(victim->getWorldOrientation()); 166 } 167 it->first->startControl(entity); 172 COUT(2) << "Warning: Killed Pawn was not in the playerlist" << std::endl; 168 173 } 169 174 }
Note: See TracChangeset
for help on using the changeset viewer.