*** Merged Code from Multiplayer Branch Revision 2960 ***

- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-)
- Multiplayer Version 1.1 + some additional features and bugfixes
* INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory *




git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2009-06-04 21:01:45 +00:00
parent 17f44f63e8
commit 47db604b50
301 changed files with 76701 additions and 1843 deletions
+16 -4
View File
@@ -121,6 +121,8 @@
#include "Mercs.h"
#include "INIReader.h"
#include "VFS/vfs.h"
//rain
#include "Rain.h"
//end rain
@@ -142,7 +144,6 @@ extern void ResetJA2ClockGlobalTimers( void );
extern void BeginLoadScreen( void );
extern void EndLoadScreen();
extern CPostalService gPostalService;
//Global variable used
@@ -1920,6 +1921,7 @@ BOOLEAN Inventory::Save( HWFILE hFile, bool fSavingMap )
// The save directory now resides in the data directory (default or custom)
BOOLEAN InitSaveDir()
{
#ifndef USE_VFS
// Look for a custom data dir first
std::string dataDir = gCustomDataCat.GetRootDir();
if( dataDir.empty() || FileGetAttributes( (STR) dataDir.c_str() ) == 0xFFFFFFFF ) {
@@ -1945,7 +1947,16 @@ BOOLEAN InitSaveDir()
return FALSE;
}
}
#else
if(is_networked)
{
sprintf( gSaveDir, "%s", utf8string::as_utf8(pMessageStrings[ MSG_MPSAVEDIRECTORY ] + 3).c_str() );
}
else
{
sprintf( gSaveDir, "%s", utf8string::as_utf8(pMessageStrings[ MSG_SAVEDIRECTORY ] + 3).c_str() );
}
#endif
return TRUE;
}
@@ -6635,7 +6646,8 @@ void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *p
//loop through all the mercs on the players team to find the one that is not moving
for ( pSoldier = MercPtrs[ sSoldierCnt ]; sSoldierCnt <= bLastTeamID; sSoldierCnt++,pSoldier++)
{
if( pSoldier->bActive )
// test for !NULL (if initilization fails and MercPtrs contains 'NULL's)
if( pSoldier && pSoldier->bActive )
{
if ( pSoldier->bAssignment != IN_TRANSIT && !pSoldier->flags.fBetweenSectors)
{
@@ -6659,7 +6671,7 @@ void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *p
//loop through all the mercs and find one that is moving
for ( pSoldier = MercPtrs[ sSoldierCnt ]; sSoldierCnt <= bLastTeamID; sSoldierCnt++,pSoldier++)
{
if( pSoldier->bActive )
if( pSoldier && pSoldier->bActive )
{
//we found an alive, merc that is not moving
*psSectorX = pSoldier->sSectorX;