mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged from revision: 7525
- Fixed bug with game selecting helicopter loading screen when reloading game (by anv) - Fixed autoplace stacks logic from sector inventory on r7380 commit (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7526 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+3
-2
@@ -19,6 +19,7 @@
|
||||
#include "Strategic Movement.h"
|
||||
#include "UndergroundInit.h"
|
||||
#include <string>
|
||||
#include "strategicmap.h"
|
||||
|
||||
extern HVSURFACE ghFrameBuffer;
|
||||
extern BOOLEAN gfSchedulesHosed;
|
||||
@@ -358,9 +359,9 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
|
||||
|
||||
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE | VSURFACE_CREATE_FROMPNG_FALLBACK;
|
||||
|
||||
szSector = szSectorMap [gWorldSectorY][gWorldSectorX];
|
||||
const BOOLEAN fExternalLS = (szSector != NULL) && ((DAY <= ubLoadScreenID && ubLoadScreenID <= NIGHT_ALT) || (ubLoadScreenID == UNDERGROUND));
|
||||
|
||||
|
||||
|
||||
if (fExternalLS)
|
||||
{
|
||||
// Get the image path
|
||||
|
||||
+65
-49
@@ -7009,19 +7009,19 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
if (pSoldier->inv[HANDPOS].exists() == false)
|
||||
{
|
||||
// put the one-handed weapon in the guy's hand...
|
||||
PlaceObject( pSoldier, HANDPOS, pObj, fNewItem );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
if( PlaceObject( pSoldier, HANDPOS, pObj, fNewItem ) )
|
||||
{
|
||||
return( TRUE );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
else if ( !(Item[pSoldier->inv[HANDPOS].usItem].twohanded ) && pSoldier->inv[SECONDHANDPOS].exists() == false)
|
||||
{
|
||||
// put the one-handed weapon in the guy's 2nd hand...
|
||||
PlaceObject( pSoldier, SECONDHANDPOS, pObj, fNewItem );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
if( PlaceObject( pSoldier, SECONDHANDPOS, pObj, fNewItem ) )
|
||||
{
|
||||
return( TRUE );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
// two-handed objects are best handled in the main loop for large objects,
|
||||
@@ -7035,18 +7035,22 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
case IC_GUN:
|
||||
if(pSoldier->inv[GUNSLINGPOCKPOS].exists() == false) // Long Gun use Gun Sling
|
||||
{
|
||||
PlaceObject( pSoldier, GUNSLINGPOCKPOS, pObj, fNewItem );
|
||||
if (pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if( PlaceObject( pSoldier, GUNSLINGPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if (pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IC_THROWING_KNIFE:
|
||||
case IC_BLADE:
|
||||
if(pSoldier->inv[KNIFEPOCKPOS].exists() == false) // Knife
|
||||
{
|
||||
PlaceObject( pSoldier, KNIFEPOCKPOS, pObj, fNewItem );
|
||||
if (pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if( PlaceObject( pSoldier, KNIFEPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if (pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -7059,10 +7063,10 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
if (pSoldier->inv[VESTPOS].exists() == false)
|
||||
{
|
||||
// put on the armour!
|
||||
PlaceObject( pSoldier, VESTPOS, pObj, fNewItem );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
if( PlaceObject( pSoldier, VESTPOS, pObj, fNewItem ) )
|
||||
{
|
||||
return( TRUE );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7079,21 +7083,21 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
if (pSoldier->inv[LEGPOS].exists() == false)
|
||||
{
|
||||
// put on the armour!
|
||||
PlaceObject( pSoldier, LEGPOS, pObj, fNewItem );
|
||||
}
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
{
|
||||
return( TRUE );
|
||||
if( PlaceObject( pSoldier, LEGPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ARMOURCLASS_HELMET:
|
||||
if (pSoldier->inv[HELMETPOS].exists() == false)
|
||||
{
|
||||
// put on the armour!
|
||||
PlaceObject( pSoldier, HELMETPOS, pObj, fNewItem );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
if( PlaceObject( pSoldier, HELMETPOS, pObj, fNewItem ) )
|
||||
{
|
||||
return( TRUE );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7105,18 +7109,18 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
case IC_FACE:
|
||||
if ( (pSoldier->inv[HEAD1POS].exists() == false) && CompatibleFaceItem( pObj->usItem, pSoldier->inv[HEAD2POS].usItem ) )
|
||||
{
|
||||
PlaceObject( pSoldier, HEAD1POS, pObj, fNewItem );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
if( PlaceObject( pSoldier, HEAD1POS, pObj, fNewItem ) )
|
||||
{
|
||||
return( TRUE );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
else if ( (pSoldier->inv[HEAD2POS].exists() == false) && CompatibleFaceItem( pObj->usItem, pSoldier->inv[HEAD1POS].usItem ) )
|
||||
{
|
||||
PlaceObject( pSoldier, HEAD2POS, pObj, fNewItem );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
if( PlaceObject( pSoldier, HEAD2POS, pObj, fNewItem ) )
|
||||
{
|
||||
return( TRUE );
|
||||
if ( pObj->exists() == false || fStackOrSingleSlot )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -7128,22 +7132,30 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
lbeClass = LoadBearingEquipment[pItem->ubClassIndex].lbeClass;
|
||||
if(lbeClass == THIGH_PACK) // Thigh pack
|
||||
{
|
||||
if (pSoldier->inv[LTHIGHPOCKPOS].exists() == false) {
|
||||
PlaceObject( pSoldier, LTHIGHPOCKPOS, pObj, fNewItem );
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if (pSoldier->inv[LTHIGHPOCKPOS].exists() == false)
|
||||
{
|
||||
if( PlaceObject( pSoldier, LTHIGHPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
if (pSoldier->inv[RTHIGHPOCKPOS].exists() == false) {
|
||||
PlaceObject( pSoldier, RTHIGHPOCKPOS, pObj, fNewItem );
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if (pSoldier->inv[RTHIGHPOCKPOS].exists() == false)
|
||||
{
|
||||
if( PlaceObject( pSoldier, RTHIGHPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(pSoldier->inv[VESTPOCKPOS].exists() == false && lbeClass == VEST_PACK) // Vest pack
|
||||
{
|
||||
PlaceObject( pSoldier, VESTPOCKPOS, pObj, fNewItem );
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if( PlaceObject( pSoldier, VESTPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
else if(pSoldier->inv[CPACKPOCKPOS].exists() == false && lbeClass == COMBAT_PACK) // Combat pack
|
||||
{
|
||||
@@ -7152,9 +7164,11 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
//DBrot: changed to bitwise comparison
|
||||
if((pSoldier->inv[BPACKPOCKPOS].exists() == true && packCombo != 0 && (backCombo & packCombo)) || pSoldier->inv[BPACKPOCKPOS].exists() == false)
|
||||
{
|
||||
PlaceObject( pSoldier, CPACKPOCKPOS, pObj, fNewItem );
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if( PlaceObject( pSoldier, CPACKPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(pSoldier->inv[BPACKPOCKPOS].exists() == false && lbeClass == BACKPACK) // Backpack
|
||||
@@ -7167,12 +7181,14 @@ BOOLEAN AutoPlaceObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLEAN fNew
|
||||
//DBrot: changed to bitwise comparison
|
||||
if((pSoldier->inv[CPACKPOCKPOS].exists() == true && backCombo != 0 && (backCombo & packCombo)) || pSoldier->inv[CPACKPOCKPOS].exists() == false)
|
||||
{
|
||||
PlaceObject( pSoldier, BPACKPOCKPOS, pObj, fNewItem );
|
||||
pSoldier->flags.DropPackFlag = FALSE;
|
||||
pSoldier->flags.ZipperFlag = FALSE;
|
||||
RenderBackpackButtons(ACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
if( PlaceObject( pSoldier, BPACKPOCKPOS, pObj, fNewItem ) )
|
||||
{
|
||||
pSoldier->flags.DropPackFlag = FALSE;
|
||||
pSoldier->flags.ZipperFlag = FALSE;
|
||||
RenderBackpackButtons(ACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
|
||||
if(pObj->exists() == false || fStackOrSingleSlot)
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user