1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00
This commit is contained in:
OnionKnight
2010-11-05 14:43:14 +00:00
parent 0f4478d8cf
commit 8ad159af53

View File

@@ -2239,9 +2239,9 @@ void CGameHandler::giveHeroArtifact(int artid, int hid, int position) //pos==-1
int i; int i;
for(i=0; i<art.possibleSlots.size(); i++) //try to put artifact into first available slot for(i=0; i<art.possibleSlots.size(); i++) //try to put artifact into first available slot
{ {
if( !vstd::contains(sha.artifWorn,art.possibleSlots[i]) ) if(art.fitsAt(sha.artifWorn, art.possibleSlots[i]))
{ {
//we've found a free suitable slot //we've found a free suitable slot.
VLC->arth->equipArtifact(sha.artifWorn, art.possibleSlots[i], artid); VLC->arth->equipArtifact(sha.artifWorn, art.possibleSlots[i], artid);
break; break;
} }
@@ -2256,7 +2256,7 @@ void CGameHandler::giveHeroArtifact(int artid, int hid, int position) //pos==-1
} }
else else
{ {
if(!vstd::contains(sha.artifWorn,ui16(position))) if(art.fitsAt(sha.artifWorn, ui16(position)))
{ {
VLC->arth->equipArtifact(sha.artifWorn, position, artid); VLC->arth->equipArtifact(sha.artifWorn, position, artid);
} }