Changeset 9235 in orxonox.OLD for trunk/src/world_entities/spawning_point.cc
- Timestamp:
- Jul 5, 2006, 4:39:02 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/spawning_point.cc
r9008 r9235 57 57 58 58 MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL ); 59 60 this->setSynchronized( true ); 59 61 } 60 62 … … 102 104 void SpawningPoint::spawn(Playable* entity) 103 105 { 106 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE ); 107 108 bool found = false; 109 110 if ( !list ) 111 return; 112 113 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 114 { 115 if ( *it == entity ) 116 { 117 found = true; 118 break; 119 } 120 } 121 122 if ( !found ) 123 return; 124 104 125 PRINTF(0)("Spawningpoint spawns Entity (%s)\n", entity->getClassName()); 105 126 … … 137 158 this->spawn(it->entity); 138 159 139 if ( SharedNetworkData::getInstance()->isGameServer() ) 160 const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE ); 161 162 bool found = false; 163 164 if ( !list ) 165 return; 166 167 for ( std::list<BaseObject*>::const_iterator it2 = list->begin(); it2 != list->end(); it2++ ) 168 { 169 if ( *it2 == it->entity ) 170 { 171 found = true; 172 break; 173 } 174 } 175 176 if ( found && SharedNetworkData::getInstance()->isGameServer() ) 140 177 this->sendRespawnMessage( it->entity->getUniqueID() ); 141 178 … … 194 231 assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE ); 195 232 233 PRINTF(0)("SPAWNMESSAGE %d\n", uniqueId); 234 196 235 SpawningPoint * sp = NULL; 197 236 Playable * playable = NULL; … … 203 242 for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ ) 204 243 { 205 if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == uniqueId ) 244 PRINTF(0)("%d:%d\n", dynamic_cast<SpawningPoint*>(*it)->getUniqueID(), spUniqueId); 245 if ( dynamic_cast<SpawningPoint*>(*it)->getUniqueID() == spUniqueId ) 206 246 { 207 247 sp = dynamic_cast<SpawningPoint*>(*it); … … 213 253 if ( !sp ) 214 254 { 215 PRINTF( 2)("could not find spawning point\n");255 PRINTF(0)("could not find spawning point\n"); 216 256 return false; 217 257 } … … 233 273 if ( !playable ) 234 274 { 235 PRINTF( 2)("could not find playable\n");275 PRINTF(0)("could not find playable\n"); 236 276 return false; 237 277 }
Note: See TracChangeset
for help on using the changeset viewer.