Changeset 48801af in network-game for server/server.cpp
- Timestamp:
- Nov 11, 2014, 1:20:11 AM (10 years ago)
- Branches:
- master
- Children:
- 85da778
- Parents:
- c941e07
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
rc941e07 r48801af 139 139 switch (p->team) 140 140 { 141 case 1:// blue team141 case Player::TEAM_BLUE: 142 142 spawnPos = p->currentGame->getMap()->getStructureLocation(STRUCTURE_BLUE_FLAG); 143 143 break; 144 case 2:// red team144 case Player::TEAM_RED: 145 145 spawnPos = p->currentGame->getMap()->getStructureLocation(STRUCTURE_RED_FLAG); 146 146 break; … … 781 781 map<unsigned int, Player*>& oldPlayers = g->getPlayers(); 782 782 g->addPlayer(p); 783 p->team = 0;783 p->team = Player::TEAM_NONE; 784 784 785 785 // send info to other players … … 922 922 case STRUCTURE_BLUE_FLAG: 923 923 { 924 if (p->team == 1&& p->hasRedFlag) {924 if (p->team == Player::TEAM_BLUE && p->hasRedFlag) { 925 925 // check that your flag is at your base 926 926 pos = game->getMap()->getStructureLocation(STRUCTURE_BLUE_FLAG); … … 951 951 case STRUCTURE_RED_FLAG: 952 952 { 953 if (p->team == 2&& p->hasBlueFlag) {953 if (p->team == Player::TEAM_RED && p->hasBlueFlag) { 954 954 // check that your flag is at your base 955 955 pos = game->getMap()->getStructureLocation(STRUCTURE_RED_FLAG); … … 1048 1048 1049 1049 if (posDistance(p->pos, pos.toFloat()) < 10) { 1050 if (p->team == 1&& itObjects->type == OBJECT_BLUE_FLAG) {1050 if (p->team == Player::TEAM_BLUE && itObjects->type == OBJECT_BLUE_FLAG) { 1051 1051 structPos = game->getMap()->getStructureLocation(STRUCTURE_BLUE_FLAG); 1052 1052 flagReturned = true; 1053 1053 break; 1054 } else if (p->team == 2&& itObjects->type == OBJECT_RED_FLAG) {1054 } else if (p->team == Player::TEAM_RED && itObjects->type == OBJECT_RED_FLAG) { 1055 1055 structPos = game->getMap()->getStructureLocation(STRUCTURE_RED_FLAG); 1056 1056 flagReturned = true;
Note:
See TracChangeset
for help on using the changeset viewer.