Move iter->exists() check to first

This commit is contained in:
Asdow
2026-06-12 15:52:24 +03:00
parent 9b654ff3f1
commit 6a8a22aba2
10 changed files with 38 additions and 38 deletions
+1 -1
View File
@@ -2081,7 +2081,7 @@ UINT8 HandleNonActivatedTossCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEA
//sevenfm this should be checked only for guns because we can throw items with attached explosives
if(Item[pObj->usItem].usItemClass & IC_WEAPON )
for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != (*pObj)[0]->attachments.end(); ++iter) {
if ( Item[ iter->usItem ].usItemClass & IC_EXPLOSV && iter->exists())
if ( iter->exists() && Item[ iter->usItem ].usItemClass & IC_EXPLOSV )
{
pObject = &(*iter);
break;