- Timestamp:
- Nov 8, 2014, 1:38:54 AM (10 years ago)
- Branches:
- master
- Children:
- 347d768
- Parents:
- 306758e
- Location:
- server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
server/DataAccess.cpp
r306758e r7fa452f 180 180 // the columns are result, team, blue score, and red score 181 181 // for result 0 is defeat and 1 is victory 182 // for team, 0 is blue and 1is red182 // for team, 1 is blue and 2 is red 183 183 184 184 MYSQL_RES *result; … … 205 205 206 206 if (blueScore == 3) { 207 if (userTeam == 0)207 if (userTeam == 1) 208 208 gameResult = 1; 209 209 else 210 210 gameResult = 0; 211 211 }else if (redScore == 3) { 212 if (userTeam == 1)212 if (userTeam == 2) 213 213 gameResult = 1; 214 214 else -
server/server.cpp
r306758e r7fa452f 139 139 switch (p->team) 140 140 { 141 case 0:// blue team141 case 1:// blue team 142 142 spawnPos = p->currentGame->getMap()->getStructureLocation(STRUCTURE_BLUE_FLAG); 143 143 break; 144 case 1:// red team144 case 2:// red team 145 145 spawnPos = p->currentGame->getMap()->getStructureLocation(STRUCTURE_RED_FLAG); 146 146 break; … … 191 191 int winningTeam = -1; 192 192 if (game->getBlueScore() == 3) 193 winningTeam = 0;193 winningTeam = 1; 194 194 else if (game->getRedScore() == 3) 195 winningTeam = 1;195 winningTeam = 2; 196 196 197 197 if (winningTeam == -1) … … 780 780 map<unsigned int, Player*>& oldPlayers = g->getPlayers(); 781 781 g->addPlayer(p); 782 p->team = -1;782 p->team = 0; 783 783 784 784 // send info to other players … … 921 921 case STRUCTURE_BLUE_FLAG: 922 922 { 923 if (p->team == 0&& p->hasRedFlag) {923 if (p->team == 1 && p->hasRedFlag) { 924 924 // check that your flag is at your base 925 925 pos = game->getMap()->getStructureLocation(STRUCTURE_BLUE_FLAG); … … 950 950 case STRUCTURE_RED_FLAG: 951 951 { 952 if (p->team == 1&& p->hasBlueFlag) {952 if (p->team == 2 && p->hasBlueFlag) { 953 953 // check that your flag is at your base 954 954 pos = game->getMap()->getStructureLocation(STRUCTURE_RED_FLAG); … … 1047 1047 1048 1048 if (posDistance(p->pos, pos.toFloat()) < 10) { 1049 if (p->team == 0&& itObjects->type == OBJECT_BLUE_FLAG) {1049 if (p->team == 1 && itObjects->type == OBJECT_BLUE_FLAG) { 1050 1050 structPos = game->getMap()->getStructureLocation(STRUCTURE_BLUE_FLAG); 1051 1051 flagReturned = true; 1052 1052 break; 1053 } else if (p->team == 1&& itObjects->type == OBJECT_RED_FLAG) {1053 } else if (p->team == 2 && itObjects->type == OBJECT_RED_FLAG) { 1054 1054 structPos = game->getMap()->getStructureLocation(STRUCTURE_RED_FLAG); 1055 1055 flagReturned = true;
Note:
See TracChangeset
for help on using the changeset viewer.