mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
* fixed bullet artifacts and removal !
* hopefull disable of grenades * added a LOS check from your mercs to a door to see if it should be animated or not. * looked into the "ENEMY_ENABLED" issue, it is not double defined, the one in network.h is part of a struct and not connected. made some changes to do tests for ==0 or ==1 rather than boolean. but i believe there must be some misunderstanding possibly. ENEMY_ENABLED only enables or disables the enemy AI, And only when coop is enabled... when its not there is no ai whatsoever, but you can still get into deathmatch battle under the various ini settings. enjoy, the bullets are finishing themselves off much better now ! :) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2168 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+29
-8
@@ -96,6 +96,8 @@ unsigned char packetIdentifier;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#include "keys.h"
|
||||
|
||||
#include "new.h"
|
||||
#include "Types.h"
|
||||
#include "connect.h"
|
||||
@@ -240,10 +242,10 @@ char ckbag[100];
|
||||
int REPORT_NAME;
|
||||
int WEAPON_READIED_BONUS;
|
||||
|
||||
int ENEMY_ENABLED=0;
|
||||
int CREATURE_ENABLED=0;
|
||||
int MILITIA_ENABLED=0;
|
||||
int CIV_ENABLED=0;
|
||||
int ENEMY_ENABLED;
|
||||
int CREATURE_ENABLED;
|
||||
int MILITIA_ENABLED;
|
||||
int CIV_ENABLED;
|
||||
|
||||
int ALLOW_EQUIP;
|
||||
|
||||
@@ -1925,6 +1927,7 @@ void recieveBULLET(RPCParameters *rpcParameters)
|
||||
BULLET * pBullet;
|
||||
|
||||
iBullet = CreateBullet( netb->net_bullet.ubFirerID, 0, netb->net_bullet.usFlags,netb->usHandItem );
|
||||
|
||||
if (iBullet == -1)
|
||||
{
|
||||
ScreenMsg( FONT_YELLOW, MSG_CHAT, L"Failed to create bullet");
|
||||
@@ -1934,6 +1937,8 @@ void recieveBULLET(RPCParameters *rpcParameters)
|
||||
bTable[bTeam][net_iBullet].remote_id = net_iBullet;
|
||||
bTable[bTeam][net_iBullet].local_id = iBullet;
|
||||
|
||||
|
||||
|
||||
pBullet = GetBulletPtr( iBullet );
|
||||
|
||||
//ScreenMsg( FONT_YELLOW, MSG_CHAT, L"Created Bullet Id: %d",iBullet);
|
||||
@@ -2120,14 +2125,17 @@ void send_miss(EV_S_MISS * SMiss)
|
||||
void recievehitSTRUCT (RPCParameters *rpcParameters)
|
||||
{
|
||||
EV_S_STRUCTUREHIT* struct_hit = (EV_S_STRUCTUREHIT*)rpcParameters->input;
|
||||
|
||||
//ScreenMsg( FONT_YELLOW, MSG_CHAT, L"recieved structure hit");
|
||||
SOLDIERTYPE *pSoldier = MercPtrs[ struct_hit->ubAttackerID ];
|
||||
INT8 bTeam=pSoldier->bTeam;
|
||||
INT32 iBullet = bTable[bTeam][struct_hit->iBullet].local_id;
|
||||
|
||||
|
||||
if(struct_hit->fStopped)StopBullet( iBullet );//, ScreenMsg( FONT_YELLOW, MSG_CHAT, L"bullet stopped");
|
||||
StructureHit( iBullet, struct_hit->usWeaponIndex, struct_hit->bWeaponStatus, struct_hit->ubAttackerID, struct_hit->sXPos, struct_hit->sYPos, struct_hit->sZPos, struct_hit->usStructureID, struct_hit->iImpact, struct_hit->fStopped );
|
||||
if(struct_hit->fStopped)RemoveBullet(iBullet);
|
||||
//ScreenMsg( FONT_YELLOW, MSG_CHAT, L"recieved structure hit");
|
||||
if(struct_hit->fStopped)RemoveBullet(iBullet);//, ScreenMsg( FONT_YELLOW, MSG_CHAT, L"bullet removed");
|
||||
//else ScreenMsg( FONT_YELLOW, MSG_CHAT, L"bullet left");
|
||||
|
||||
}
|
||||
void recievehitWINDOW (RPCParameters *rpcParameters)
|
||||
{
|
||||
@@ -2420,7 +2428,15 @@ void recieve_door (RPCParameters *rpcParameters)
|
||||
doors* sDoor = (doors*)rpcParameters->input;
|
||||
|
||||
SOLDIERTYPE *pSoldier = MercPtrs[ sDoor->ubID ];
|
||||
HandleDoorChangeFromGridNo( pSoldier, sDoor->sGridNo, sDoor->fNoAnimations );
|
||||
BOOLEAN fNoAnimations = FALSE;
|
||||
|
||||
if ( !AllMercsLookForDoor( sDoor->sGridNo, FALSE ) )//check for los
|
||||
{
|
||||
fNoAnimations = TRUE;
|
||||
}
|
||||
|
||||
|
||||
HandleDoorChangeFromGridNo( pSoldier, sDoor->sGridNo, fNoAnimations );
|
||||
|
||||
}
|
||||
|
||||
@@ -2578,6 +2594,11 @@ void connect_client ( void )
|
||||
gTacticalStatus.uiFlags&= (~SHOW_ALL_MERCS );
|
||||
memset( &readyteamreg , 0 , sizeof (int) * 10);
|
||||
|
||||
ENEMY_ENABLED=0;
|
||||
CREATURE_ENABLED=0;
|
||||
MILITIA_ENABLED=0;
|
||||
CIV_ENABLED=0;
|
||||
|
||||
//retrieve settings from Ja2_mp.ini
|
||||
char ip[30];
|
||||
char port[30];
|
||||
|
||||
@@ -60,4 +60,5 @@ void teamwiped (void);
|
||||
|
||||
BOOLEAN check_status (void);
|
||||
extern UINT8 NumEnemyInSector( );
|
||||
extern INT8 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
|
||||
extern INT8 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ void start_server (void)
|
||||
|
||||
char hire_same_merc[30];
|
||||
char bteam1_enabled[30];
|
||||
char bteam2_enabled[30];
|
||||
//char bteam2_enabled[30];
|
||||
char bteam3_enabled[30];
|
||||
char bteam4_enabled[30];
|
||||
|
||||
@@ -434,7 +434,7 @@ void start_server (void)
|
||||
GetPrivateProfileString( "Ja2_mp Settings","DAMAGE_MULTIPLIER", "", net_div, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
GetPrivateProfileString( "Ja2_mp Settings","ENEMY_ENABLED", "", bteam1_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","CREATURE_ENABLED", "", bteam2_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
//GetPrivateProfileString( "Ja2_mp Settings","CREATURE_ENABLED", "", bteam2_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","MILITIA_ENABLED", "", bteam3_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
GetPrivateProfileString( "Ja2_mp Settings","CIV_ENABLED", "", bteam4_enabled, MAX_PATH, "..\\Ja2_mp.ini" );
|
||||
|
||||
@@ -477,7 +477,7 @@ void start_server (void)
|
||||
if(gsPLAYER_BSIDE==2)//only enable ai during coop
|
||||
{
|
||||
ENEMY_ENABLED =atoi(bteam1_enabled);
|
||||
CREATURE_ENABLED =atoi(bteam2_enabled);
|
||||
//CREATURE_ENABLED =atoi(bteam2_enabled);
|
||||
MILITIA_ENABLED =atoi(bteam3_enabled);
|
||||
CIV_ENABLED =atoi(bteam4_enabled);
|
||||
|
||||
|
||||
@@ -11,3 +11,4 @@ INT8 FireBullet( SOLDIERTYPE * pFirer, BULLET * pBullet, BOOLEAN fFake );
|
||||
extern bool ovh_advance;
|
||||
extern bool ovh_ready;
|
||||
void request_ovh(UINT8 ubID);
|
||||
|
||||
|
||||
@@ -938,7 +938,7 @@ void CreatureAttackTown( UINT8 ubSectorID, BOOLEAN fOverrideTest )
|
||||
case CREATURE_BATTLE_CODE_TACTICALLYADD:
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
if(is_server && CREATURE_ENABLED==1)
|
||||
PrepareCreaturesForBattle();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -771,7 +771,7 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
|
||||
if (gfStrategicMilitiaChangesMade)
|
||||
{
|
||||
RemoveMilitiaFromTactical();
|
||||
if(is_server && MILITIA_ENABLED)
|
||||
if(is_server && MILITIA_ENABLED==1)
|
||||
PrepareMilitiaForTactical(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1206,7 +1206,7 @@ void AddPossiblePendingEnemiesToBattle()
|
||||
static UINT8 ubPredefinedInsertionCode = 255;
|
||||
|
||||
// haydent
|
||||
if ((is_client && !is_server) || !ENEMY_ENABLED)
|
||||
if ((is_client && !is_server) || ENEMY_ENABLED==0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ void AddPossiblePendingMilitiaToBattle()
|
||||
static UINT8 ubPredefinedRank = 255;
|
||||
|
||||
// Haydent
|
||||
if ((is_client && !is_server) || !MILITIA_ENABLED)
|
||||
if ((is_client && !is_server) || MILITIA_ENABLED==0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1749,7 +1749,7 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && ENEMY_ENABLED)
|
||||
if(is_server && ENEMY_ENABLED==1)
|
||||
PrepareEnemyForSectorBattle();
|
||||
}
|
||||
else
|
||||
@@ -1768,7 +1768,7 @@ BOOLEAN SetCurrentWorldSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
if(is_server && CREATURE_ENABLED==1)
|
||||
PrepareCreaturesForBattle();
|
||||
}
|
||||
else
|
||||
@@ -2074,7 +2074,7 @@ void PrepareLoadedSector()
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if( is_server && fAddCivs && CIV_ENABLED)//hayden its around here we apply .ini choices for Ai
|
||||
if( is_server && fAddCivs && CIV_ENABLED==1)//hayden its around here we apply .ini choices for Ai
|
||||
{
|
||||
AddSoldierInitListTeamToWorld( CIV_TEAM, 255 );
|
||||
}
|
||||
@@ -2084,10 +2084,10 @@ void PrepareLoadedSector()
|
||||
AddSoldierInitListTeamToWorld( CIV_TEAM, 255 );
|
||||
}
|
||||
|
||||
if(is_server && MILITIA_ENABLED)
|
||||
if(is_server && MILITIA_ENABLED==1)
|
||||
AddSoldierInitListTeamToWorld( MILITIA_TEAM, 255 );
|
||||
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
if(is_server && CREATURE_ENABLED==1)
|
||||
AddSoldierInitListBloodcats();
|
||||
|
||||
//Creatures are only added if there are actually some of them. It has to go through some
|
||||
@@ -2121,11 +2121,11 @@ void PrepareLoadedSector()
|
||||
// Haydent
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CREATURE_ENABLED)
|
||||
if(is_server && CREATURE_ENABLED==1)
|
||||
PrepareCreaturesForBattle();
|
||||
|
||||
// Haydent
|
||||
if(is_server && MILITIA_ENABLED)
|
||||
if(is_server && MILITIA_ENABLED==1)
|
||||
PrepareMilitiaForTactical(FALSE);
|
||||
}
|
||||
else
|
||||
@@ -2148,7 +2148,7 @@ void PrepareLoadedSector()
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && CIV_ENABLED)
|
||||
if(is_server && CIV_ENABLED==1)
|
||||
AddProfilesNotUsingProfileInsertionData(); //hayden: is just for civ's
|
||||
}
|
||||
else
|
||||
@@ -2160,7 +2160,7 @@ void PrepareLoadedSector()
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server && ENEMY_ENABLED)
|
||||
if(is_server && ENEMY_ENABLED==1)
|
||||
fEnemyPresenceInThisSector = PrepareEnemyForSectorBattle();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "lighting.h"
|
||||
#include "Buildings.h"
|
||||
#endif
|
||||
#include "test_space.h"
|
||||
|
||||
|
||||
// Defines
|
||||
|
||||
@@ -2174,7 +2174,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// IF POSSIBLE, FIRE LONG RANGE WEAPONS AT TARGETS REPORTED BY RADIO
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if(!is_networked)//hayden
|
||||
{
|
||||
// can't do this in realtime, because the player could be shooting a gun or whatever at the same time!
|
||||
if (gfTurnBasedAI && !fCivilian && !bInWater && !bInGas && !(pSoldier->flags.uiStatusFlags & SOLDIER_BOXER) && (CanNPCAttack(pSoldier) == TRUE))
|
||||
{
|
||||
@@ -2251,6 +2252,8 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
|
||||
}
|
||||
}
|
||||
|
||||
}//hayden
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3937,6 +3940,8 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
// this looks for throwables, and sets BestThrow.ubPossible if it can be done
|
||||
//if ( !gfHiddenInterrupt )
|
||||
// {
|
||||
if(!is_networked) //disable for mp ai
|
||||
{
|
||||
CheckIfTossPossible(pSoldier,&BestThrow);
|
||||
|
||||
if (BestThrow.ubPossible)
|
||||
@@ -3973,7 +3978,7 @@ INT8 DecideActionBlack(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user