mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Brief: //dnl ch76
- Debug performance improvement when working with inventory and UDB. Details: - Open UDB was quite slow and then clicking at some attachment slots halted game for few seconds. - Moving mouse over opened inventory slots with hundreds of items jerking and halting mouse for moment. - Fix CTD in rare occasions after attach and then remove GL and try attach some improper attachment. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6570 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+4
-3
@@ -2267,8 +2267,8 @@ BOOLEAN ValidItemAttachmentSlot( OBJECTTYPE * pObj, UINT16 usAttachment, BOOLEAN
|
||||
BOOLEAN fSimilarItems = FALSE, fSameItem = FALSE, fNoSpace = FALSE;
|
||||
UINT16 usSimilarItem = NOTHING;
|
||||
INT16 ubSlotIndex = 0;
|
||||
INT32 iLoop2 = 0;
|
||||
INT16 sTimesToRun = 0;
|
||||
// INT32 iLoop2 = 0;
|
||||
// INT16 sTimesToRun = 0;
|
||||
UINT8 curSlot = 0;
|
||||
UINT8 ubVolumeTaken;
|
||||
BOOLEAN foundValidAttachment = FALSE;
|
||||
@@ -2324,7 +2324,8 @@ BOOLEAN ValidItemAttachmentSlot( OBJECTTYPE * pObj, UINT16 usAttachment, BOOLEAN
|
||||
//Do we want to check all attachment slots or just the one in slotcount?
|
||||
if(slotCount == -1){
|
||||
//Loop through slots
|
||||
for(UINT8 curSlot = 0; curSlot < (*pObj)[subObject]->attachments.size() && !foundValidAttachment; curSlot++){
|
||||
UINT32 uiSlots = min((*pObj)[subObject]->attachments.size(), usAttachmentSlotIndexVector.size());//dnl??? ch76 091113 ugly fix as AK74 after attach/remove GL will have more attachments then usAttachmentSlotIndexVector which lead to CTD
|
||||
for(UINT8 curSlot = 0; curSlot < uiSlots && !foundValidAttachment; curSlot++){
|
||||
//Any attachment that is already in this slot will go here.
|
||||
OBJECTTYPE * pAttachment;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user