mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -37,7 +37,7 @@ void GetSectorFacilitiesFlags( INT16 sMapX, INT16 sMapY, STR16 sFacilitiesString
|
||||
if( SectorInfo[ SECTOR( sMapX, sMapY ) ].uiFacilitiesFlags == 0 )
|
||||
{
|
||||
// none
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 0 ] );
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 0 ] );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ void GetSectorFacilitiesFlags( INT16 sMapX, INT16 sMapY, STR16 sFacilitiesString
|
||||
{
|
||||
if( wcslen( sFacilitiesString ) == 0 )
|
||||
{
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 2 ] );
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 2 ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -67,7 +67,7 @@ void GetSectorFacilitiesFlags( INT16 sMapX, INT16 sMapY, STR16 sFacilitiesString
|
||||
{
|
||||
if( wcslen( sFacilitiesString ) == 0 )
|
||||
{
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 3 ] );
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 3 ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -81,7 +81,7 @@ void GetSectorFacilitiesFlags( INT16 sMapX, INT16 sMapY, STR16 sFacilitiesString
|
||||
{
|
||||
if( wcslen( sFacilitiesString ) == 0 )
|
||||
{
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 5 ] );
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 5 ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -95,7 +95,7 @@ void GetSectorFacilitiesFlags( INT16 sMapX, INT16 sMapY, STR16 sFacilitiesString
|
||||
{
|
||||
if( wcslen( sFacilitiesString ) == 0 )
|
||||
{
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 6 ] );
|
||||
swprintf( sFacilitiesString, L"%s", sFacilitiesStrings[ 6 ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -103,7 +103,7 @@ void GetSectorFacilitiesFlags( INT16 sMapX, INT16 sMapY, STR16 sFacilitiesString
|
||||
wcscat( sFacilitiesString, sFacilitiesStrings[ 6 ]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sFacilitiesString[ wcslen( sFacilitiesString ) ] = 0;
|
||||
|
||||
return;
|
||||
@@ -138,7 +138,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
}
|
||||
*/
|
||||
if( NumHostilesInSector( sMapX, sMapY, bMapZ ) )
|
||||
{ //too premature: enemies still in sector.
|
||||
{ //too premature: enemies still in sector.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
LaptopSaveInfo.fBobbyRSiteCanBeAccessed = TRUE;
|
||||
|
||||
//If the player has been to Bobbyr when it was down, and we havent already sent email, send him an email
|
||||
if( LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction == BOBBYR_BEEN_TO_SITE_ONCE && LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction != BOBBYR_ALREADY_SENT_EMAIL )
|
||||
if( LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction == BOBBYR_BEEN_TO_SITE_ONCE && LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction != BOBBYR_ALREADY_SENT_EMAIL )
|
||||
{
|
||||
AddEmail( BOBBYR_NOW_OPEN, BOBBYR_NOW_OPEN_LENGTH, BOBBY_R, GetWorldTotalMin(), -1);
|
||||
LaptopSaveInfo.ubHaveBeenToBobbyRaysAtLeastOnceWhileUnderConstruction = BOBBYR_ALREADY_SENT_EMAIL;
|
||||
@@ -206,7 +206,7 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
{
|
||||
if ( 1 /*!GetSectorFlagStatus( sMapX, sMapY, bMapZ, SF_SECTOR_HAS_BEEN_LIBERATED_ONCE ) */)
|
||||
{
|
||||
// SAM site liberated for first time, schedule meanwhile
|
||||
// SAM site liberated for first time, schedule meanwhile
|
||||
HandleMeanWhileEventPostingForSAMLiberation( GetSAMIdFromSector( sMapX, sMapY, bMapZ ) );
|
||||
}
|
||||
|
||||
@@ -268,13 +268,13 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
SectorInfo[ SECTOR( sMapX, sMapY ) ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
}
|
||||
|
||||
//KM : Aug 11, 1999 -- Patch fix: Relocated this check so it gets called everytime a sector changes hands,
|
||||
// even if the sector isn't a SAM site. There is a bug _somewhere_ that fails to update the airspace,
|
||||
// even though the player controls it.
|
||||
//KM : Aug 11, 1999 -- Patch fix: Relocated this check so it gets called everytime a sector changes hands,
|
||||
// even if the sector isn't a SAM site. There is a bug _somewhere_ that fails to update the airspace,
|
||||
// even though the player controls it.
|
||||
UpdateAirspaceControl( );
|
||||
|
||||
// redraw map/income if in mapscreen
|
||||
fMapPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fMapScreenBottomDirty = TRUE;
|
||||
|
||||
return fWasEnemyControlled;
|
||||
@@ -291,8 +291,8 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
||||
UINT8 ubSectorID;
|
||||
|
||||
//KM : August 6, 1999 Patch fix
|
||||
// This check was added because this function gets called when player mercs retreat from an unresolved
|
||||
// battle between militia and enemies. It will get called again AFTER autoresolve is finished.
|
||||
// This check was added because this function gets called when player mercs retreat from an unresolved
|
||||
// battle between militia and enemies. It will get called again AFTER autoresolve is finished.
|
||||
if( gfAutomaticallyStartAutoResolve )
|
||||
{
|
||||
return( FALSE );
|
||||
@@ -310,7 +310,7 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
||||
if ( fWasPlayerControlled )
|
||||
{
|
||||
if( PlayerMercsInSector( (UINT8)sMapX, (UINT8)sMapY, (UINT8)bMapZ ) )
|
||||
{ //too premature: Player mercs still in sector.
|
||||
{ //too premature: Player mercs still in sector.
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -361,13 +361,13 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
||||
NotifyPlayerWhenEnemyTakesControlOfImportantSector( sMapX, sMapY, 0, fContested );
|
||||
}
|
||||
|
||||
// NOTE: Stealing is intentionally OUTSIDE the fWasPlayerControlled branch. This function gets called if new
|
||||
// NOTE: Stealing is intentionally OUTSIDE the fWasPlayerControlled branch. This function gets called if new
|
||||
// enemy reinforcements arrive, and they deserve another crack at stealing what the first group missed! :-)
|
||||
|
||||
// stealing should fail anyway 'cause there shouldn't be a temp file for unvisited sectors, but let's check anyway
|
||||
if ( GetSectorFlagStatus( sMapX, sMapY, ( UINT8 ) bMapZ, SF_ALREADY_VISITED ) == TRUE )
|
||||
{
|
||||
// enemies can steal items left lying about (random chance). The more there are, the more they take!
|
||||
// enemies can steal items left lying about (random chance). The more there are, the more they take!
|
||||
ubTheftChance = 5 * NumEnemiesInAnySector( sMapX, sMapY, bMapZ );
|
||||
// max 90%, some stuff may just simply not get found
|
||||
if (ubTheftChance > 90 )
|
||||
@@ -386,13 +386,13 @@ BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BO
|
||||
SectorInfo[ SECTOR( sMapX, sMapY ) ].fPlayer[ bMapZ ] = FALSE;
|
||||
}
|
||||
|
||||
//KM : Aug 11, 1999 -- Patch fix: Relocated this check so it gets called everytime a sector changes hands,
|
||||
// even if the sector isn't a SAM site. There is a bug _somewhere_ that fails to update the airspace,
|
||||
// even though the player controls it.
|
||||
//KM : Aug 11, 1999 -- Patch fix: Relocated this check so it gets called everytime a sector changes hands,
|
||||
// even if the sector isn't a SAM site. There is a bug _somewhere_ that fails to update the airspace,
|
||||
// even though the player controls it.
|
||||
UpdateAirspaceControl( );
|
||||
|
||||
// redraw map/income if in mapscreen
|
||||
fMapPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fMapScreenBottomDirty = TRUE;
|
||||
|
||||
return fWasPlayerControlled;
|
||||
@@ -440,7 +440,7 @@ void MakePlayerPerceptionOfSectorControlCorrect( INT16 sMapX, INT16 sMapY, INT8
|
||||
{
|
||||
if (bMapZ == 0)
|
||||
{
|
||||
SectorInfo[ SECTOR( sMapX, sMapY ) ].fPlayer[ bMapZ ] = !( StrategicMap[ CALCULATE_STRATEGIC_INDEX( sMapX, sMapY ) ].fEnemyControlled );
|
||||
SectorInfo[ SECTOR( sMapX, sMapY ) ].fPlayer[ bMapZ ] = !( StrategicMap[ CALCULATE_STRATEGIC_INDEX( sMapX, sMapY ) ].fEnemyControlled );
|
||||
}
|
||||
// else nothing, underground sector control is always up to date, because we don't track control down there
|
||||
|
||||
@@ -472,5 +472,5 @@ void ReplaceSoldierProfileInPlayerGroup( UINT8 ubGroupID, UINT8 ubOldProfile, UI
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user