mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Serializer will now smartly send over network CArtifact* and CHero*. Unified handling of items stored in vector.
Started making support for Black Market / Artifact merchant.
This commit is contained in:
@@ -487,7 +487,7 @@ DLL_EXPORT void SetHeroArtifacts::applyGs( CGameState *gs )
|
||||
if(h->getArtPos(id) >= 0)
|
||||
continue;
|
||||
|
||||
CArtifact &art = VLC->arth->artifacts[id];
|
||||
CArtifact &art = *VLC->arth->artifacts[id];
|
||||
art.addBonusesTo(&h->bonuses);
|
||||
art.addBonusesTo(&gained);
|
||||
}
|
||||
@@ -503,7 +503,7 @@ DLL_EXPORT void SetHeroArtifacts::applyGs( CGameState *gs )
|
||||
if(h->getArtPos(id) >= 0)
|
||||
continue;
|
||||
|
||||
CArtifact &art = VLC->arth->artifacts[id];
|
||||
CArtifact &art = *VLC->arth->artifacts[id];
|
||||
art.removeBonusesFrom(&h->bonuses);
|
||||
art.addBonusesTo(&lost);
|
||||
}
|
||||
@@ -606,6 +606,25 @@ DLL_EXPORT void NewObject::applyGs( CGameState *gs )
|
||||
assert(o->defInfo);
|
||||
}
|
||||
|
||||
DLL_EXPORT void SetAvailableArtifacts::applyGs( CGameState *gs )
|
||||
{
|
||||
if(id >= 0)
|
||||
{
|
||||
if(CGBlackMarket *bm = dynamic_cast<CGBlackMarket*>(gs->map->objects[id]))
|
||||
{
|
||||
bm->artifacts = arts;
|
||||
}
|
||||
else
|
||||
{
|
||||
tlog1 << "Wrong black market id!" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CGTownInstance::merchantArtifacts = arts;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
|
||||
{
|
||||
gs->day = day;
|
||||
|
||||
Reference in New Issue
Block a user