Changeset 9574 in orxonox.OLD for branches/proxy/src/util
- Timestamp:
- Jul 28, 2006, 5:01:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/util/multiplayer_team_deathmatch.cc
r9565 r9574 195 195 } 196 196 197 if ( box != NULL 198 && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) 199 && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() != TEAM_NOTEAM 200 && !bShowTeamChange 197 198 // check if the menu should be removed and the game state should be entered 199 if ( box != NULL && 200 PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) && 201 PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() != TEAM_NOTEAM && 202 !bShowTeamChange 201 203 ) 202 204 { 205 // this is actualy good 206 // assert(false); 207 203 208 delete box; 204 209 box = NULL; … … 312 317 assert( false ); 313 318 } 319 314 320 315 321 std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, ClassID classId ) … … 444 450 } 445 451 452 /** 453 * this handles team changes but only on the master server 454 */ 446 455 void MultiplayerTeamDeathmatch::handleTeamChanges( ) 447 456 { … … 460 469 if ( stats.getPreferedTeamId() == TEAM_SPECTATOR || ( stats.getPreferedTeamId() >= 0 && stats.getPreferedTeamId() < numTeams ) ) 461 470 { 462 teamChange( stats.get UserId() );471 teamChange( stats.getAssignedUserId() ); 463 472 } 464 473 } … … 475 484 { 476 485 stats.setPreferedTeamId( getRandomTeam() ); 477 teamChange( stats.get UserId() );486 teamChange( stats.getAssignedUserId() ); 478 487 } 479 488 } … … 481 490 } 482 491 492 493 494 /** 495 * changes the team 496 * @param userId the user changing team (userId) 497 */ 483 498 void MultiplayerTeamDeathmatch::teamChange( int userId ) 484 499 { … … 491 506 492 507 493 ClassID playableClassId= getPlayableClassId( userId, stats.getPreferedTeamId() );494 std::string playableModel= getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId );495 std::string playableTexture= getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId );496 float playableScale= getPlayableScale( userId, stats.getPreferedTeamId(), playableClassId );508 ClassID playableClassId = getPlayableClassId( userId, stats.getPreferedTeamId() ); 509 std::string playableModel = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId ); 510 std::string playableTexture = getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId ); 511 float playableScale = getPlayableScale( userId, stats.getPreferedTeamId(), playableClassId ); 497 512 498 513 BaseObject * bo = Factory::fabricate( playableClassId ); … … 514 529 stats.setTeamId( stats.getPreferedTeamId() ); 515 530 516 playable.setTeam(stats.getPreferedTeamId());531 // playable.setTeam(stats.getPreferedTeamId()); 517 532 518 533 … … 527 542 } 528 543 544 529 545 void MultiplayerTeamDeathmatch::onButtonExit( ) 530 546 { … … 563 579 } 564 580 565 /** 566 * function that processes events from the handler 567 * @param event: the event 568 * @todo replace SDLK_o with something from KeyMapper 569 */ 581 582 /** 583 * function that processes events from the handler 584 * @param event: the event 585 * @todo replace SDLK_o with something from KeyMapper 586 */ 570 587 void MultiplayerTeamDeathmatch::process( const Event & event ) 571 588 {
Note: See TracChangeset
for help on using the changeset viewer.