From 736f2a194d2f8d67f305d77d57edc2c107070212 Mon Sep 17 00:00:00 2001 From: haydent Date: Tue, 27 May 2008 10:01:04 +0000 Subject: [PATCH] *disable tank spawning, and fix bug causing lack of AI to spawn in maps with snipers or tanks. *small change associated with hidden interrupts now occuring and not necessarily only being between AI to hopefully stop crashes. (thanks for the call stack!) *added no gear option 4 MERC *disable explosions git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2202 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/mercs Files.cpp | Bin 57208 -> 59884 bytes Multiplayer/client.cpp | 10 ++++++---- Multiplayer/fresh_header.h | 3 +++ Multiplayer/server.cpp | 27 ++------------------------- Multiplayer/test_space.cpp | 2 +- Tactical/Soldier Create.cpp | 27 +++++++++++---------------- Tactical/Soldier Init List.cpp | 9 +++++++++ Tactical/TeamTurns.cpp | 2 +- TileEngine/Explosion Control.cpp | 8 ++++++-- 9 files changed, 39 insertions(+), 49 deletions(-) diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index a631651ae6e19539d5f91d00a32ca2f8387690b2..bc84eefd6625bce5ab168d77be47751b9a66ffa2 100644 GIT binary patch delta 707 zcmZuvUr5tY7(KsDU0b;=Th0l~-*3%7YqHJJNU~K6B2BHCrRYm+D8nHenL!k?3VZ3H z9uD**Mfg&0!VP*UH+?FCAhaHp?NOozz4X|fWAIzV$K~VR``vTSckcIR-S}h6xc0>D zOd=~|9xATjDlXw7Vz`C@@z}j(aC)TH z?EZ^cBqX*E9x--0r%-KaXCcrobDL=jew;*v?lY^E9`ul6ssC3a%g3z$Y3}gEkWh$$)cXVA;h4ky#J@Mp{-=Fg@LT#GyO94wv-itp#&+W3CL!qBc)7N`vD zc2x@N7*wgh%CN-PvP+cWFATN9f1H0ccZBwBD-Y~c;i|cwH+S!-D2?y6var~on8oMx z?>;_VX;H%B+v{${$7taLX delta 152 zcmV;J0B8T~(*yXv1F(u6v!)%+1G73JE*P`$KIR0o+(c>ulZZkbv#>{)50hA0Mw7tk z2$PVL3bI(90+W2+7Lx{BLX+w~3bUeH>K2orX#|rnYzC8HY6P>Oa^x|SsKpSo#-y?$ z1ug(004$S{&^42=$1Ial#45Au$S47m!k{FxNXilcv#QKO2b0v*GP5Mq!UVF}wgR)x G+a3;$p+$%Q diff --git a/Multiplayer/client.cpp b/Multiplayer/client.cpp index cd65ad15..e89d0147 100644 --- a/Multiplayer/client.cpp +++ b/Multiplayer/client.cpp @@ -115,7 +115,7 @@ unsigned char packetIdentifier; #include "test_space.h" #include "interface panels.h" - +#include "game init.h" extern INT8 SquadMovementGroups[ ]; RakPeerInterface *client; @@ -1783,7 +1783,7 @@ void requestSETTINGS(void) cl_name.cl_edge=atoi(SECT_EDGE); - + client->RPC("requestSETTINGS",(const char*)&cl_name, (int)sizeof(client_info)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0); } @@ -2408,6 +2408,7 @@ void UpdateSoldierFromNetwork (RPCParameters *rpcParameters) { gTacticalStatus.usTactialTurnLimitCounter = SUpdateNetworkSoldier->usTactialTurnLimitCounter; gTacticalStatus.usTactialTurnLimitMax = SUpdateNetworkSoldier->usTactialTurnLimitMax; + } } @@ -2760,6 +2761,7 @@ void connect_client ( void ) if( !is_connected && !is_connecting) { + recieved_settings=0; goahead = 0; numready = 0; @@ -2805,7 +2807,7 @@ void connect_client ( void ) GetPrivateProfileString( "Ja2_mp Settings","CLIENT_NAME", "", clname, MAX_PATH, "..\\Ja2_mp.ini" ); - + char op1[30]; @@ -2846,7 +2848,7 @@ void connect_client ( void ) /*netbTeam = (CLIENT_NUM)+5; ubID_prefix = gTacticalStatus.Team[ netbTeam ].bFirstID;*/ - + //********************** diff --git a/Multiplayer/fresh_header.h b/Multiplayer/fresh_header.h index da15531c..87df7f1e 100644 --- a/Multiplayer/fresh_header.h +++ b/Multiplayer/fresh_header.h @@ -4,6 +4,8 @@ extern int readyteamreg[10]; +extern bool NOGEAR; + typedef struct { UINT16 soldier_id; @@ -49,6 +51,7 @@ void unlock (void); void UpdateSoldierToNetwork ( SOLDIERTYPE *pSoldier ); extern BOOLEAN gfUIInterfaceSetBusy; +void TrashAllSoldiers( ); void kick_player (void); void overide_turn (void); diff --git a/Multiplayer/server.cpp b/Multiplayer/server.cpp index e4b50c81..388b7713 100644 --- a/Multiplayer/server.cpp +++ b/Multiplayer/server.cpp @@ -23,7 +23,7 @@ INT32 gsMAX_MERCS; bool gsMORALE; int gsREPORT_NAME; - +#include "game init.h" #include "text.h" #include "connect.h" @@ -391,30 +391,6 @@ void requestSETTINGS(RPCParameters *rpcParameters ) } -//void rOVH (RPCParameters *rpcParameters) -//{ -// ovh_struct* rovhs = (ovh_struct*)rpcParameters->input; -// -// -// -// ++mercs_ready[rovhs->ubid]; -// //ncr++; -// nc = server->NumberOfConnections(); -// -// if(mercs_ready[rovhs->ubid] >= nc) -// { -// mercs_ready[rovhs->ubid]=0; -// ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"advance %d",rovhs->ubid ); -// -// adv aoh; -// aoh.ubid=rovhs->ubid; -// -// server->RPC("advance_ovh_frame",(const char*)&aoh, (int)sizeof(adv)*8, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,0); -// -// } -// -//} - void start_server (void) { @@ -593,6 +569,7 @@ if(gsPLAYER_BSIDE==2)//only enable ai during coop ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[1]); ScreenMsg( FONT_LTBLUE, MSG_CHAT, MPServerMessage[2]); is_server = true; + connect_client();//connect client to server } else diff --git a/Multiplayer/test_space.cpp b/Multiplayer/test_space.cpp index 702f6b82..28fe9809 100644 --- a/Multiplayer/test_space.cpp +++ b/Multiplayer/test_space.cpp @@ -104,7 +104,7 @@ bool ovh_ready; #include "opplist.h" #include "fresh_header.h" //int cnt = 40; - +#include "game init.h" void test_func2 (void)//now bound to "0" { diff --git a/Tactical/Soldier Create.cpp b/Tactical/Soldier Create.cpp index f53cdb7f..9b66c913 100644 --- a/Tactical/Soldier Create.cpp +++ b/Tactical/Soldier Create.cpp @@ -49,6 +49,7 @@ #include "connect.h" #include "message.h" +#include "fresh_header.h" // THESE 3 DIFFICULTY FACTORS MUST ALWAYS ADD UP TO 100% EXACTLY!!! #define DIFF_FACTOR_PLAYER_PROGRESS 50 @@ -430,6 +431,8 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 * *pubID = NOBODY; DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("TacticalCreateSoldier")); + + INT8 tbTeam; BOOLEAN tfPP; tbTeam=pCreateStruct->bTeam; @@ -449,28 +452,20 @@ SOLDIERTYPE* TacticalCreateSoldier( SOLDIERCREATE_STRUCT *pCreateStruct, UINT8 * //if(is_server && tbTeam>0 && tbTeam<5) if(is_server && tbTeam>0 && tbTeam<5) { - //if(tbTeam==1 && !ENEMY_ENABLED) - //{ - // return NULL; - //} - //if(tbTeam==2 && !CREATURE_ENABLED) - //{ - // return NULL; - //} - //if(tbTeam==3 && !MILITIA_ENABLED) - //{ - // return NULL; - //} - //if(tbTeam==4 && !CIV_ENABLED) - //{ - // return NULL; - //} send_AI(pCreateStruct,pubID); } if(is_client && !is_server && tfPP==1) { pCreateStruct->fPlayerPlan = 0; } + + if(is_networked && (pCreateStruct->bBodyType==23 || pCreateStruct->bBodyType==24)) + { + ScreenMsg( FONT_YELLOW, MSG_CHAT, L"skipping tank"); + return NULL; + } + + //hayden //Kris: //Huge no no! See the header file for description of static detailed placements. diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index 2acd66bc..fa68b0a2 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -48,6 +48,8 @@ #include "Rotting Corpses.h" #endif +#include "connect.h" + #include "Map Edgepoints.h" BOOLEAN gfOriginalList = TRUE; @@ -716,7 +718,13 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL ) } DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddPlacementToWorld: create soldier")); + + if(is_networked && (tempDetailedPlacement.bBodyType==23 || tempDetailedPlacement.bBodyType==24 || tempDetailedPlacement.fOnRoof==1))return TRUE; + + pSoldier = TacticalCreateSoldier( &tempDetailedPlacement, &ubID ); + + if( pSoldier ) { curr->pSoldier = pSoldier; @@ -744,6 +752,7 @@ BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *curr, GROUP *pGroup = NULL ) } DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddPlacementToWorld: return false")); + if(is_server) ScreenMsg( FONT_YELLOW, MSG_CHAT, L"report this MP error (AddPlacementToWorld-FAIL!)"); return FALSE; } diff --git a/Tactical/TeamTurns.cpp b/Tactical/TeamTurns.cpp index e2dced72..feabe8fc 100644 --- a/Tactical/TeamTurns.cpp +++ b/Tactical/TeamTurns.cpp @@ -919,7 +919,7 @@ void StartInterrupt( void ) // pSoldier = MercPtrs[ubFirstInterrupter]; //if ( gTacticalStatus.ubCurrentTeam == OUR_TEAM) - if ( pSoldier->bTeam != OUR_TEAM ) + if ( pSoldier->bTeam > OUR_TEAM && pSoldier->bTeam < 6) { // we're being interrupted by the computer! // we delay displaying any interrupt message until the computer diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index 13b031f6..f3074dc7 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -69,7 +69,7 @@ #endif #include "Soldier Macros.h" - +#include "connect.h" //forward declarations of common classes to eliminate includes class OBJECTTYPE; class SOLDIERTYPE; @@ -2280,7 +2280,11 @@ void SpreadEffect( INT16 sGridNo, UINT8 ubRadius, UINT16 usItem, UINT8 ubOwner, fSmokeEffect = TRUE; break; } - +if(is_networked) +{ + ScreenMsg( FONT_LTBLUE, MSG_CHAT, L"explosives not coded in MP"); + return; +} // Set values for recompile region to optimize area we need to recompile for MPs gsRecompileAreaTop = sGridNo / WORLD_COLS; gsRecompileAreaLeft = sGridNo % WORLD_COLS;