mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Move iter->exists() check to first
This commit is contained in:
+1
-1
@@ -171,7 +171,7 @@ INT32 GetSpreadPattern( OBJECTTYPE * pObj )
|
||||
//If there are attachments, check them. Stop on the first one with something defined.
|
||||
//Dear God, I hate C++ iterators. What a fugly mess. //WarmSteel - I made it even messier ;3
|
||||
for (attachmentList::iterator iter = pObj[0][0]->attachments.begin(); iter != pObj[0][0]->attachments.end(); ++iter){
|
||||
if( (n=Item[ iter->usItem ].spreadPattern) && iter->exists()){
|
||||
if( iter->exists() && (n=Item[ iter->usItem ].spreadPattern) ){
|
||||
//An attachment has it, and it trumps everything, so return it's value.
|
||||
return n;}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user