1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

* Fixed bug 101, placing artifacts in specific slots in the backpack. Cleaned up swapArtifacts() to use more descriptive names as well.

This commit is contained in:
OnionKnight
2009-11-10 03:10:14 +00:00
parent db4ee5844f
commit 64a72c39cb
4 changed files with 57 additions and 36 deletions

View File

@ -451,17 +451,18 @@ DLL_EXPORT void SetHeroArtifacts::setArtAtPos(ui16 pos, int art)
if(pos<19)
artifWorn.erase(pos);
else
artifacts -= artifacts[pos-19];
artifacts.erase(artifacts.begin() + (pos - 19));
}
else
{
if(pos<19)
if (pos < 19) {
artifWorn[pos] = art;
else
if(pos-19 < artifacts.size())
artifacts[pos-19] = art;
} else { // Goes into the backpack.
if(pos - 19 < artifacts.size())
artifacts.insert(artifacts.begin() + (pos - 19), art);
else
artifacts.push_back(art);
}
}
}