diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index f6dee22e..25d0ff71 100644 --- a/Laptop/mercs Files.cpp +++ b/Laptop/mercs Files.cpp @@ -652,8 +652,11 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID) //Set the time and ID of the last hired merc will arrive // LaptopSaveInfo.sLastHiredMerc.iIdOfMerc = HireMercStruct.ubProfileID; // LaptopSaveInfo.sLastHiredMerc.uiArrivalTime = HireMercStruct.uiTimeTillMercArrives; - - + if(is_networked && (gMercProfiles[ ubMercID ].sSalary > LaptopSaveInfo.iCurrentBalance) ) + { + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[ 4 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL); + return(FALSE);//not enough big ones $$$sATMText + } bReturnCode = HireMerc( &HireMercStruct ); //already have 20 mercs on the team if( bReturnCode == MERC_HIRE_OVER_18_MERCS_HIRED ) diff --git a/Multiplayer/client.cpp b/Multiplayer/client.cpp index 0b6ecd08..9d7c1839 100644 --- a/Multiplayer/client.cpp +++ b/Multiplayer/client.cpp @@ -240,10 +240,10 @@ char ckbag[100]; int REPORT_NAME; int WEAPON_READIED_BONUS; - int ENEMY_ENABLED; - int CREATURE_ENABLED; - int MILITIA_ENABLED; - int CIV_ENABLED; + int ENEMY_ENABLED=0; + int CREATURE_ENABLED=0; + int MILITIA_ENABLED=0; + int CIV_ENABLED=0; int ALLOW_EQUIP; @@ -257,6 +257,8 @@ int START_TEAM_TURN; int readystage = 0; bool status = 0; + bool wiped; + bool lockedgui = 0; FLOAT DAMAGE_MULTIPLIER; @@ -638,6 +640,7 @@ void recieveHIRE(RPCParameters *rpcParameters) pSoldier = &Menptr[iNewIndex]; pSoldier->flags.uiStatusFlags |= SOLDIER_PC; + gMercProfiles[ pSoldier->ubProfile ].ubMiscFlags |= PROFILE_MISC_FLAG_RECRUITED; if(!SAME_MERC)gMercProfiles[ pSoldier->ubProfile ].bMercStatus = MERC_WORKING_ELSEWHERE; pSoldier->bSide=0; //default coop only if(PLAYER_BSIDE==0)//all vs all only @@ -2191,6 +2194,16 @@ BOOLEAN check_status (void)// any 'enemies' and clients left to fight ?? gTacticalStatus.Team[x].bMenInSector=0; } } + if( (gTacticalStatus.Team[ 0 ].bTeamActive == 0) && wiped==0)//server's team has been knocked out + { + wiped=1; + ScreenMsg( FONT_LTGREEN, MSG_CHAT, MPClientMessage[40] ); + gTacticalStatus.uiFlags |= SHOW_ALL_MERCS;//hayden + ScreenMsg( FONT_YELLOW, MSG_CHAT, MPClientMessage[41] ); + teamwiped(); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, MPClientMessage[42] ); + + } if((gTacticalStatus.Team[ 0 ].bTeamActive==1 || gTacticalStatus.Team[ 6 ].bTeamActive==1 || gTacticalStatus.Team[ 7 ].bTeamActive==1 || gTacticalStatus.Team[ 0 ].bTeamActive==1 || gTacticalStatus.Team[ 9 ].bTeamActive==1 )&& NumEnemyInSector() > 0)return(TRUE); else return(FALSE); @@ -2428,7 +2441,7 @@ void sendRT(void) void gotoRT(RPCParameters *rpcParameters) { - getReal=true; + getReal=true;//MAY NOT BE NEEDED ANY MORE gTacticalStatus.bConsNumTurnsNotSeen = 0; gTacticalStatus.ubCurrentTeam = OUR_TEAM; @@ -2570,7 +2583,7 @@ void connect_client ( void ) char port[30]; // char client_number[30]; char sector_edge[30]; - + wiped=0; //disable cheating gubCheatLevel = 0; diff --git a/Multiplayer/fresh_header.h b/Multiplayer/fresh_header.h index 68993644..8ae94a2c 100644 --- a/Multiplayer/fresh_header.h +++ b/Multiplayer/fresh_header.h @@ -59,4 +59,5 @@ extern int WEAPON_READIED_BONUS; void teamwiped (void); BOOLEAN check_status (void); -extern UINT8 NumEnemyInSector( ); \ No newline at end of file +extern UINT8 NumEnemyInSector( ); +extern INT8 NumActiveAndConsciousTeamMembers( UINT8 ubTeam ); \ No newline at end of file diff --git a/Multiplayer/server.cpp b/Multiplayer/server.cpp index cf7e1734..2619289c 100644 --- a/Multiplayer/server.cpp +++ b/Multiplayer/server.cpp @@ -471,13 +471,17 @@ void start_server (void) gsMAX_MERCS=atoi(max_merc); gsTESTING = atoi(test); -//// + + gsPLAYER_BSIDE = atoi(player_bside); + +if(gsPLAYER_BSIDE==2)//only enable ai during coop +{ ENEMY_ENABLED =atoi(bteam1_enabled); CREATURE_ENABLED =atoi(bteam2_enabled); MILITIA_ENABLED =atoi(bteam3_enabled); CIV_ENABLED =atoi(bteam4_enabled); - gsPLAYER_BSIDE = atoi(player_bside); +} gsSAME_MERC = atoi(hire_same_merc); gsDAMAGE_MULTIPLIER =(FLOAT)atof(net_div); diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 024dd032..fe7a4bbf 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -5932,16 +5932,10 @@ BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen ) - if(is_server && check_status()) - { - if(NumActiveAndConsciousTeamMembers( 0 ) ==0) - { - //ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"still some left"); - } - - - return(FALSE); - } + //if(is_server && check_status()) + //{ + // return(FALSE); + //} // We can only check for end of combat if in combat mode @@ -6149,13 +6143,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated ) if(is_server && check_status()) { - if(NumActiveAndConsciousTeamMembers( 0 ) ==0) - { - //ScreenMsg( FONT_LTGREEN, MSG_CHAT, L"still some left"); - } - - - return(FALSE); + return(FALSE); } // ATE: If attack busy count.. get out...