1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Minor changes (visitdir organization)

This commit is contained in:
Michał W. Urbańczyk 2009-07-19 22:16:07 +00:00
parent 1916ba6e9f
commit 3a1e252895
4 changed files with 8 additions and 10 deletions

View File

@ -90,7 +90,7 @@ void CDefObjInfoHandler::load()
}
else
{
static int visitableFromTop[] = {111,33,81,12,9,212,215,22}; //whirlpool, garrison, scholar, campfire, borderguard, bordergate, questguard, corpse
static int visitableFromTop[] = {29, 82, 86, 11, 59, 8, 111,33,81,12,9,212,215,22}; //sea chest, flotsam, shipwreck survivor, buoy, ocean bottle, boat, whirlpool, garrison, scholar, campfire, borderguard, bordergate, questguard, corpse
for(int i=0; i < ARRAY_COUNT(visitableFromTop); i++)
{
if(visitableFromTop[i] == nobj->id)

View File

@ -2627,12 +2627,7 @@ const std::string & CGBonusingObject::getHoverText() const
void CGBonusingObject::initObj()
{
if(ID == 11) //Buoy
{
defInfo->visitDir = 0xff;
blockVisit = true;
}
else if(ID == 52) //Mermaid
if(ID == 11 || ID == 52) //Buoy / Mermaid
{
blockVisit = true;
}
@ -3065,7 +3060,6 @@ void CGSignBottle::initObj()
if(ID == 59)
{
defInfo->visitDir = 0xff;
blockVisit = true;
}
}
@ -3077,6 +3071,9 @@ void CGSignBottle::onHeroVisit( const CGHeroInstance * h ) const
iw.player = h->getOwner();
iw.text << message;
cb->showInfoDialog(&iw);
if(ID == 59)
cb->removeObject(id);
}
void CGScholar::giveAnyBonus( const CGHeroInstance * h ) const
@ -3358,7 +3355,6 @@ void CGOnceVisitable::searchTomb(const CGHeroInstance *h, ui32 accept) const
void CGBoat::initObj()
{
defInfo->visitDir = 0xff;
hero = NULL;
}

View File

@ -1354,7 +1354,9 @@ void Mapa::readDefInfo( unsigned char * bufor, int &i)
}
}
else
{
vinya->visitDir = 0xff;
}
if(vinya->id == 26)
std::memset(vinya->blockMap,255,6);

View File

@ -1951,7 +1951,7 @@ bool CGameHandler::garrisonSwap( si32 tid )
bool CGameHandler::swapArtifacts( si32 hid1, si32 hid2, ui16 slot1, ui16 slot2 )
{
CGHeroInstance *h1 = gs->getHero(hid1), *h2 = gs->getHero(hid2);
if((distance(h1->pos,h2->pos) > 1.0) || (h1->tempOwner != h2->tempOwner))
if((distance(h1->pos,h2->pos) > 1.5) || (h1->tempOwner != h2->tempOwner))
return false;
const CArtifact *a1 = h1->getArt(slot1),