fix compile problems (operator<() must be const)
This commit is contained in:
@@ -81,7 +81,8 @@ bool Inventory::OnComboBroken( PlayerNumber pn, int iCombo )
|
|||||||
int* iItems = GAMESTATE->m_iItems[pn];
|
int* iItems = GAMESTATE->m_iItems[pn];
|
||||||
|
|
||||||
// search for the item acquired
|
// search for the item acquired
|
||||||
for( int item=0; item<(int)m_ItemDefs.size(); item++ )
|
int item;
|
||||||
|
for( item=0; item<(int)m_ItemDefs.size(); item++ )
|
||||||
if( m_ItemDefs[item].comboLevel > iCombo )
|
if( m_ItemDefs[item].comboLevel > iCombo )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public:
|
|||||||
int comboLevel;
|
int comboLevel;
|
||||||
CString effect;
|
CString effect;
|
||||||
|
|
||||||
bool operator<( const ItemDef& other ) { return comboLevel < other.comboLevel; }
|
bool operator<( const ItemDef& other ) const { return comboLevel < other.comboLevel; }
|
||||||
void Sort( vector<ItemDef>& items ) { sort( items.begin(), items.end() ); }
|
void Sort( vector<ItemDef>& items ) { sort( items.begin(), items.end() ); }
|
||||||
};
|
};
|
||||||
vector<ItemDef> m_ItemDefs;
|
vector<ItemDef> m_ItemDefs;
|
||||||
|
|||||||
Reference in New Issue
Block a user