1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Merged changes from trunk ( r1885 )

This commit is contained in:
Michał W. Urbańczyk
2010-12-14 18:08:21 +00:00
12 changed files with 44 additions and 41 deletions

View File

@ -444,11 +444,11 @@ DLL_EXPORT void SetHeroesInTown::applyGs( CGameState *gs )
DLL_EXPORT void SetHeroArtifacts::applyGs( CGameState *gs )
{
CGHeroInstance *h = gs->getHero(hid);
for(std::map<ui16,CArtifact*>::const_iterator i = h->artifWorn.begin(); i != h->artifWorn.end(); i++)
for(std::map<ui16, const CArtifact*>::const_iterator i = h->artifWorn.begin(); i != h->artifWorn.end(); i++)
if(!vstd::contains(artifWorn,i->first) || artifWorn[i->first] != i->second)
unequiped.push_back(i->second);
for(std::map<ui16,CArtifact*>::iterator i = artifWorn.begin(); i != artifWorn.end(); i++)
for(std::map<ui16, const CArtifact*>::iterator i = artifWorn.begin(); i != artifWorn.end(); i++)
if(!vstd::contains(h->artifWorn,i->first) || h->artifWorn[i->first] != i->second)
{
equiped.push_back(i->second);
@ -477,9 +477,9 @@ DLL_EXPORT void SetHeroArtifacts::setArtAtPos(ui16 pos, const CArtifact* art)
else // Goes into the backpack.
{
if(pos - 19 < artifacts.size())
artifacts.insert(artifacts.begin() + (pos - 19), const_cast<CArtifact*>(art));
artifacts.insert(artifacts.begin() + (pos - 19), art);
else
artifacts.push_back(const_cast<CArtifact*>(art));
artifacts.push_back(art);
}
}
}