Changeset 8782 in orxonox.OLD for branches/network/src/util/multiplayer_team_deathmatch.cc
- Timestamp:
- Jun 26, 2006, 1:35:46 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/multiplayer_team_deathmatch.cc
r8774 r8782 717 717 } 718 718 719 720 721 719 /** 720 * this function is called when a player kills another one or himself 721 * @param killedUserId 722 * @param userId 723 */ 724 void MultiplayerTeamDeathmatch::onKill( int killedUserId, int userId ) 725 { 726 assert( PlayerStats::getStats( killedUserId ) ); 727 assert( PlayerStats::getStats( userId ) ); 728 729 PlayerStats & killedStats = *PlayerStats::getStats( killedUserId ); 730 PlayerStats & stats = *PlayerStats::getStats( userId ); 731 732 if ( killedUserId != userId ) 733 stats.setScore( stats.getScore() + 1 ); 734 else 735 stats.setScore( stats.getScore() - 1 ); 736 737 killedStats.getPlayable()->toList( OM_DEAD ); 738 739 if ( killedUserId == SharedNetworkData::getInstance()->getHostID() ) 740 { 741 this->bLocalPlayerDead = true; 742 this->showStats(); 743 } 744 745 //TODO respawn killed palyer 746 747 } 748 749 /** 750 * this function is called on player respawn 751 * @param userId 752 */ 753 void MultiplayerTeamDeathmatch::onRespawn( int userId ) 754 { 755 if ( userId == SharedNetworkData::getInstance()->getHostID() ) 756 { 757 this->bLocalPlayerDead = false; 758 this->hideStats(); 759 } 760 } 761
Note: See TracChangeset
for help on using the changeset viewer.