mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
- Fix: Get Item assignement: if no valid gridno is found, let the game find one upon loading the sector instead of risking a wrong gridno assignment
- Fix: When dropping an item in strategic inventory, height values are not set - Fix: When looking for a valid gridno to drop items t via strategic inventory, WORLD_ITEM_REACHABLE is not reliable, as updated map topology trumps this. Instead rely upon finding a valid gridno once the sector is entered. - Fix: when searching for a new item dropoff gridno, search for new height too - Fix: if items are spawned mid-air, the player cannot retrieve them git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8136 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3230,7 +3230,8 @@ BOOLEAN LookForHiddenItems( INT32 sGridNo, INT8 ubLevel, BOOLEAN fSetLocator, IN
|
||||
return( fFound );
|
||||
}
|
||||
|
||||
|
||||
// Flugente 2016-04-09: this function seems dubious. The only difference from GetLargestZLevelOfItemPool is that this guarantees 0 if there is a structure.
|
||||
// That doesn't make any sense, so I'm replacing all calls of this
|
||||
INT8 GetZLevelOfItemPoolGivenStructure( INT32 sGridNo, UINT8 ubLevel, STRUCTURE *pStructure )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
|
||||
@@ -790,7 +790,7 @@ void RenderTopmostTacticalInterface( )
|
||||
sActionGridNo = sIntTileGridNo;
|
||||
}
|
||||
|
||||
bZLevel = GetZLevelOfItemPoolGivenStructure( sActionGridNo, pSoldier->pathing.bLevel, pStructure );
|
||||
bZLevel = GetLargestZLevelOfItemPool( pItemPool );
|
||||
|
||||
if ( AnyItemsVisibleOnLevel( pItemPool, bZLevel ) )
|
||||
{
|
||||
@@ -798,49 +798,47 @@ void RenderTopmostTacticalInterface( )
|
||||
|
||||
// ATE: If over items, remove locator....
|
||||
RemoveFlashItemSlot( pItemPool );
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
INT8 bCheckLevel;
|
||||
|
||||
// ATE: Allow to see list if a different level....
|
||||
if ( pSoldier->pathing.bLevel == 0 )
|
||||
{
|
||||
bCheckLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCheckLevel = 0;
|
||||
}
|
||||
|
||||
// Check if we are over an item pool
|
||||
if ( GetItemPool( gfUIOverItemPoolGridNo, &pItemPool, bCheckLevel ) )
|
||||
else
|
||||
{
|
||||
STRUCTURE *pStructure = NULL;
|
||||
INT32 sIntTileGridNo;
|
||||
INT8 bZLevel = 0;
|
||||
INT32 sActionGridNo = usMapPos;
|
||||
INT8 bCheckLevel;
|
||||
|
||||
// Get interactive tile...
|
||||
if ( ConditionalGetCurInteractiveTileGridNoAndStructure( &sIntTileGridNo , &pStructure, FALSE ) )
|
||||
// ATE: Allow to see list if a different level....
|
||||
if ( pSoldier->pathing.bLevel == 0 )
|
||||
{
|
||||
sActionGridNo = sIntTileGridNo;
|
||||
bCheckLevel = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
bCheckLevel = 0;
|
||||
}
|
||||
|
||||
bZLevel = GetZLevelOfItemPoolGivenStructure( sActionGridNo, bCheckLevel, pStructure );
|
||||
|
||||
if ( AnyItemsVisibleOnLevel( pItemPool, bZLevel ) )
|
||||
// Check if we are over an item pool
|
||||
if ( GetItemPool( gfUIOverItemPoolGridNo, &pItemPool, bCheckLevel ) )
|
||||
{
|
||||
DrawItemPoolList( pItemPool, gfUIOverItemPoolGridNo , ITEMLIST_DISPLAY, bZLevel, gusMouseXPos, gusMouseYPos );
|
||||
STRUCTURE *pStructure = NULL;
|
||||
INT32 sIntTileGridNo;
|
||||
INT8 bZLevel = 0;
|
||||
INT32 sActionGridNo = usMapPos;
|
||||
|
||||
// ATE: If over items, remove locator....
|
||||
RemoveFlashItemSlot( pItemPool );
|
||||
// Get interactive tile...
|
||||
if ( ConditionalGetCurInteractiveTileGridNoAndStructure( &sIntTileGridNo , &pStructure, FALSE ) )
|
||||
{
|
||||
sActionGridNo = sIntTileGridNo;
|
||||
}
|
||||
|
||||
bZLevel = GetLargestZLevelOfItemPool( pItemPool );
|
||||
|
||||
if ( AnyItemsVisibleOnLevel( pItemPool, bZLevel ) )
|
||||
{
|
||||
DrawItemPoolList( pItemPool, gfUIOverItemPoolGridNo , ITEMLIST_DISPLAY, bZLevel, gusMouseXPos, gusMouseYPos );
|
||||
|
||||
// ATE: If over items, remove locator....
|
||||
RemoveFlashItemSlot( pItemPool );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -854,9 +852,9 @@ void RenderTopmostTacticalInterface( )
|
||||
}
|
||||
|
||||
// Check if we should render item selection window
|
||||
if ( gCurrentUIMode == OPENDOOR_MENU_MODE )
|
||||
if ( gCurrentUIMode == OPENDOOR_MENU_MODE )
|
||||
{
|
||||
RenderOpenDoorMenu( );
|
||||
RenderOpenDoorMenu( );
|
||||
}
|
||||
|
||||
if ( gfInTalkPanel )
|
||||
@@ -887,8 +885,7 @@ void RenderTopmostTacticalInterface( )
|
||||
{
|
||||
RemoveMouseRegionForPauseOfClock( );
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( !(guiTacticalInterfaceFlags & INTERFACE_NORENDERBUTTONS ) )
|
||||
{
|
||||
// If we want to rederaw whole screen, dirty all buttons!
|
||||
@@ -896,13 +893,12 @@ void RenderTopmostTacticalInterface( )
|
||||
{
|
||||
MarkButtonsDirty( );
|
||||
}
|
||||
|
||||
|
||||
|
||||
RenderButtons( );
|
||||
RenderPausedGameBox( );
|
||||
}
|
||||
|
||||
// mark all pop ups as dirty
|
||||
// mark all pop ups as dirty
|
||||
MarkAllBoxesAsAltered( );
|
||||
|
||||
HandleShowingOfTacticalInterfaceFastHelpText( );
|
||||
|
||||
@@ -1563,6 +1563,9 @@ BOOLEAN LoadAndAddWorldItemsFromTempFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
if( pWorldItems[cnt].usFlags & WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT )
|
||||
{
|
||||
pWorldItems[cnt].sGridNo = gMapInformation.sCenterGridNo;
|
||||
|
||||
// if we move the item, recalculate the height
|
||||
pWorldItems[cnt].bRenderZHeightAboveLevel = -1;
|
||||
}
|
||||
|
||||
//add the item to the world
|
||||
|
||||
@@ -5549,9 +5549,7 @@ void HandleHandCursorClick( INT32 usMapPos, UINT32 *puiNewEvent )
|
||||
}
|
||||
else if ( UIOkForItemPickup( pSoldier, sActionGridNo ) )
|
||||
{
|
||||
INT8 bZLevel;
|
||||
|
||||
bZLevel = GetZLevelOfItemPoolGivenStructure( sActionGridNo, pSoldier->pathing.bLevel, pStructure );
|
||||
INT8 bZLevel = GetLargestZLevelOfItemPool( pItemPool );
|
||||
|
||||
SoldierPickupItem( pSoldier, pItemPool->iItemIndex, sActionGridNo, bZLevel );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user