Merged revision(s) 6879 from branches/ja2_source_official_2014:

Editor fixes (by Buggler):
- fixed incorrect item display after deleting map-placed item in stack
- revert r5949 code for item deletion from item pool


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6880 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-02-04 18:47:07 +00:00
parent ec646ba426
commit f3b4b46751
3 changed files with 9 additions and 4 deletions
+7 -1
View File
@@ -1136,6 +1136,7 @@ void DeleteSelectedItem()
SpecifyItemToEdit( &gWorldItems[ gpItemPool->pNext->iItemIndex ].object, gpItemPool->sGridNo ); SpecifyItemToEdit( &gWorldItems[ gpItemPool->pNext->iItemIndex ].object, gpItemPool->sGridNo );
} }
sGridNo = gpItemPool->sGridNo; sGridNo = gpItemPool->sGridNo;
//remove the item //remove the item
if( gWorldItems[ gpItemPool->iItemIndex ].object.usItem == ACTION_ITEM ) if( gWorldItems[ gpItemPool->iItemIndex ].object.usItem == ACTION_ITEM )
{ {
@@ -1148,8 +1149,13 @@ void DeleteSelectedItem()
gpEditingItemPool = NULL; gpEditingItemPool = NULL;
RemoveItemFromPool( sGridNo, gpItemPool->iItemIndex, 0 ); RemoveItemFromPool( sGridNo, gpItemPool->iItemIndex, 0 );
gpItemPool = NULL; gpItemPool = NULL;
//determine if there are still any items at this location //determine if there are still any items at this location
if( !GetItemPoolFromGround( sGridNo, &gpItemPool ) ) if( GetItemPoolFromGround( sGridNo, &gpItemPool ) )
{ //reset display for remaining items
SpecifyItemToEdit( &gWorldItems[ gpItemPool->iItemIndex ].object, gpItemPool->sGridNo );
}
else
{ //no items left, so remove the node from the list. { //no items left, so remove the node from the list.
IPListNode *pIPPrev, *pIPCurr; IPListNode *pIPPrev, *pIPCurr;
pIPCurr = pIPHead; pIPCurr = pIPHead;
+1 -2
View File
@@ -398,8 +398,7 @@ void ExecuteItemStatsCmd( /*UINT8*/ UINT16 ubAction )
case ITEMSTATS_DEFAULT: case ITEMSTATS_DEFAULT:
break; break;
case ITEMSTATS_DELETE: case ITEMSTATS_DELETE:
if( gbEditingMode != EDITING_NOTHING ) DeleteSelectedItem();
DeleteSelectedItem();
break; break;
case ITEMSTATS_SHOW: case ITEMSTATS_SHOW:
ShowSelectedItem(); ShowSelectedItem();
+1 -1
View File
@@ -1506,7 +1506,7 @@ void HandleKeyboardShortcuts( )
break; break;
case DEL: case DEL:
if( iCurrentTaskbar == TASK_ITEMS && gbEditingMode != 0 ) //gbEditingMode != EDITING_NOTHING if( iCurrentTaskbar == TASK_ITEMS )
DeleteSelectedItem(); DeleteSelectedItem();
else if( gsSelectedMercID != -1 ) else if( gsSelectedMercID != -1 )
{ {