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:
parent
fa4ee94cf9
commit
49b7fc590d
@ -732,10 +732,10 @@ DLL_EXPORT void HeroLevelUp::applyGs( CGameState *gs )
|
|||||||
}
|
}
|
||||||
switch (it->subtype)
|
switch (it->subtype)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
|
it->val = (level * (*creatures)[it->additionalInfo]->attack)/creLevel /20;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
it->val = (level * (*creatures)[it->additionalInfo]->defence)/creLevel /20;
|
it->val = (level * (*creatures)[it->additionalInfo]->defence)/creLevel /20;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -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"))
|
&& complain("Cannot teleport hero to town without Castle gate in it"))
|
||||||
return false;
|
return false;
|
||||||
int3 pos = t->visitablePos();
|
int3 pos = t->visitablePos();
|
||||||
pos.x++;//FIXME: get visitable position in more correct way (if any)
|
pos += h->getVisitableOffset();
|
||||||
stopHeroVisitCastle(from->id, hid);
|
stopHeroVisitCastle(from->id, hid);
|
||||||
moveHero(hid,pos,1);
|
moveHero(hid,pos,1);
|
||||||
heroVisitCastle(dstid, hid);
|
heroVisitCastle(dstid, hid);
|
||||||
@ -1916,7 +1916,7 @@ void CGameHandler::setOwner(int objid, ui8 owner)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CGObjectInstance * obj = getObj(objid);
|
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)
|
BOOST_FOREACH(const CGTownInstance *t, gs->getPlayer(owner)->towns)
|
||||||
if (t->subID == 5 && vstd::contains(t->builtBuildings, 22))
|
if (t->subID == 5 && vstd::contains(t->builtBuildings, 22))
|
||||||
setPortalDwelling(t);//set initial creatures for all portals of summoning
|
setPortalDwelling(t);//set initial creatures for all portals of summoning
|
||||||
|
Loading…
Reference in New Issue
Block a user