1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix for Portal of Summoning. (ID is type of object, id is position of object instance in the map vector of object instances)

Most correct way of getting visitable position ;)
This commit is contained in:
Michał W. Urbańczyk 2010-07-12 10:42:51 +00:00
parent fa4ee94cf9
commit 49b7fc590d
2 changed files with 5 additions and 5 deletions

View File

@ -732,10 +732,10 @@ DLL_EXPORT void HeroLevelUp::applyGs( CGameState *gs )
}
switch (it->subtype)
{
case 1:
it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
case 1:
it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
break;
case 2:
case 2:
it->val = (level * (*creatures)[it->additionalInfo]->defence)/creLevel /20;
break;
}

View File

@ -1886,7 +1886,7 @@ bool CGameHandler::teleportHero(si32 hid, si32 dstid, ui8 source, ui8 asker/* =
&& complain("Cannot teleport hero to town without Castle gate in it"))
return false;
int3 pos = t->visitablePos();
pos.x++;//FIXME: get visitable position in more correct way (if any)
pos += h->getVisitableOffset();
stopHeroVisitCastle(from->id, hid);
moveHero(hid,pos,1);
heroVisitCastle(dstid, hid);
@ -1916,7 +1916,7 @@ void CGameHandler::setOwner(int objid, ui8 owner)
}
const CGObjectInstance * obj = getObj(objid);
if ((obj->id == 17 || obj->id == 20 ) && gs->getPlayer(owner)->dwellings.size()==1 )//first dwelling captured
if ((obj->ID == 17 || obj->ID == 20 ) && gs->getPlayer(owner)->dwellings.size()==1 )//first dwelling captured
BOOST_FOREACH(const CGTownInstance *t, gs->getPlayer(owner)->towns)
if (t->subID == 5 && vstd::contains(t->builtBuildings, 22))
setPortalDwelling(t);//set initial creatures for all portals of summoning