mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -29,6 +29,9 @@
|
||||
#endif
|
||||
|
||||
#include "SaveLoadGame.h"
|
||||
#include "debug control.h"
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -41,9 +44,6 @@ UINT16 FromSmokeTypeToWorldFlags( INT8 bType );
|
||||
|
||||
|
||||
|
||||
#define NUM_SMOKE_EFFECT_SLOTS 25
|
||||
|
||||
|
||||
// GLOBAL FOR SMOKE LISTING
|
||||
SMOKEEFFECT gSmokeEffectData[ NUM_SMOKE_EFFECT_SLOTS ];
|
||||
UINT32 guiNumSmokeEffects = 0;
|
||||
@@ -88,7 +88,7 @@ void RecountSmokeEffects( void )
|
||||
|
||||
|
||||
// Returns NO_SMOKE_EFFECT if none there...
|
||||
INT8 GetSmokeEffectOnTile( INT16 sGridNo, INT8 bLevel )
|
||||
INT8 GetSmokeEffectOnTile( INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
UINT16 ubExtFlags;
|
||||
|
||||
@@ -171,7 +171,7 @@ UINT16 FromSmokeTypeToWorldFlags( INT8 bType )
|
||||
|
||||
|
||||
|
||||
INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
INT32 NewSmokeEffect( INT32 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner, BOOL fFromRemoteClient )
|
||||
{
|
||||
SMOKEEFFECT *pSmoke;
|
||||
INT32 iSmokeIndex;
|
||||
@@ -180,6 +180,33 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
if( ( iSmokeIndex = GetFreeSmokeEffect() )==(-1) )
|
||||
return(-1);
|
||||
|
||||
// OJW - 20091027 - Syncronising smoke effect start for multiplayer
|
||||
if (is_networked && is_client)
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = MercPtrs[ubOwner];
|
||||
if (pSoldier != NULL)
|
||||
{
|
||||
if (pSoldier->bTeam == 0 || (pSoldier->bTeam == 1 && is_server))
|
||||
{
|
||||
// let all the other clients know we are spawning this effect
|
||||
// and align them with our random number generator
|
||||
send_newsmokeeffect(sGridNo,usItem,ubOwner,bLevel,iSmokeIndex);
|
||||
}
|
||||
else if (!fFromRemoteClient)
|
||||
{
|
||||
// skip executing locally because we want the random number generator to be aligned
|
||||
// with the client that spawns set off the smoke effect
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#ifdef JA2BETAVERSION
|
||||
CHAR tmpMPDbgString[512];
|
||||
sprintf(tmpMPDbgString,"NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n",sGridNo, usItem , ubOwner , bLevel , iSmokeIndex );
|
||||
MPDebugMsg(tmpMPDbgString);
|
||||
gfMPDebugOutputRandoms = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
memset( &gSmokeEffectData[ iSmokeIndex ], 0, sizeof( SMOKEEFFECT ) );
|
||||
|
||||
pSmoke = &gSmokeEffectData[ iSmokeIndex ];
|
||||
@@ -257,7 +284,7 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
}
|
||||
|
||||
// ATE: FALSE into subsequent-- it's the first one!
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex );
|
||||
SpreadEffect( pSmoke->sGridNo, pSmoke->ubRadius, pSmoke->usItem, pSmoke->ubOwner, FALSE, bLevel, iSmokeIndex , fFromRemoteClient , TRUE );
|
||||
|
||||
return( iSmokeIndex );
|
||||
}
|
||||
@@ -265,8 +292,14 @@ INT32 NewSmokeEffect( INT16 sGridNo, UINT16 usItem, INT8 bLevel, UINT8 ubOwner )
|
||||
|
||||
// Add smoke to gridno
|
||||
// ( Replacement algorithm uses distance away )
|
||||
void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8 bLevel )
|
||||
void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
CHAR tmpMPDbgString[512];
|
||||
sprintf(tmpMPDbgString,"AddSmokeEffectToTile ( iSmokeEffectID : %i , bType : %i , sGridNo : %i , bLevel : %i )\n", iSmokeEffectID, bType , sGridNo , bLevel );
|
||||
MPDebugMsg(tmpMPDbgString);
|
||||
#endif
|
||||
|
||||
ANITILE_PARAMS AniParams;
|
||||
ANITILE *pAniTile;
|
||||
SMOKEEFFECT *pSmoke;
|
||||
@@ -444,8 +477,14 @@ void AddSmokeEffectToTile( INT32 iSmokeEffectID, INT8 bType, INT16 sGridNo, INT8
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
|
||||
void RemoveSmokeEffectFromTile( INT16 sGridNo, INT8 bLevel )
|
||||
void RemoveSmokeEffectFromTile( INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
#ifdef JA2BETAVERSION
|
||||
CHAR tmpMPDbgString[512];
|
||||
sprintf(tmpMPDbgString,"RemoveSmokeEffectFromTile ( sGridNo : %i , bLevel : %i )\n", sGridNo, bLevel );
|
||||
MPDebugMsg(tmpMPDbgString);
|
||||
#endif
|
||||
|
||||
ANITILE *pAniTile;
|
||||
UINT8 ubLevelID;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user