- fixed Ctrl+M not moving items from/to the roof

- fixed Ctrl+S, Ctrl+F, Ctrl+M, Ctrl+R affect not visible items

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1078 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-07-19 14:29:05 +00:00
parent 610df320a5
commit 429ca31658
5 changed files with 15 additions and 13 deletions
+5 -4
View File
@@ -3050,18 +3050,19 @@ BOOLEAN RemoveItemFromPool( INT16 sGridNo, INT32 iItemIndex, UINT8 ubLevel )
return( FALSE );
}
BOOLEAN MoveItemPools( INT16 sStartPos, INT16 sEndPos )
BOOLEAN MoveItemPools( INT16 sStartPos, INT16 sEndPos, INT8 bStartLevel, INT8 bEndLevel )
{
// note, only works between locations on the ground
ITEM_POOL *pItemPool;
WORLDITEM TempWorldItem;
// While there is an existing pool
while( GetItemPool( sStartPos, &pItemPool, 0 ) )
while( GetItemPool( sStartPos, &pItemPool, bStartLevel ) )
{
memcpy( &TempWorldItem, &(gWorldItems[ pItemPool->iItemIndex ]), sizeof( WORLDITEM ) );
RemoveItemFromPool( sStartPos, pItemPool->iItemIndex, 0 );
AddItemToPool( sEndPos, &(TempWorldItem.o), -1, TempWorldItem.ubLevel, TempWorldItem.usFlags, TempWorldItem.bRenderZHeightAboveLevel );
RemoveItemFromPool( sStartPos, pItemPool->iItemIndex, bStartLevel );
//AddItemToPool( sEndPos, &(TempWorldItem.o), -1, TempWorldItem.ubLevel, TempWorldItem.usFlags, TempWorldItem.bRenderZHeightAboveLevel );
AddItemToPool( sEndPos, &(TempWorldItem.o), -1, bEndLevel, TempWorldItem.usFlags, TempWorldItem.bRenderZHeightAboveLevel );
}
return( TRUE );
}