mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-02 23:07:36 +02:00
Minor changes (visitdir organization)
This commit is contained in:
parent
1916ba6e9f
commit
3a1e252895
@ -90,7 +90,7 @@ void CDefObjInfoHandler::load()
|
|||||||
}
|
}
|
||||||
else
|
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++)
|
for(int i=0; i < ARRAY_COUNT(visitableFromTop); i++)
|
||||||
{
|
{
|
||||||
if(visitableFromTop[i] == nobj->id)
|
if(visitableFromTop[i] == nobj->id)
|
||||||
|
@ -2627,12 +2627,7 @@ const std::string & CGBonusingObject::getHoverText() const
|
|||||||
|
|
||||||
void CGBonusingObject::initObj()
|
void CGBonusingObject::initObj()
|
||||||
{
|
{
|
||||||
if(ID == 11) //Buoy
|
if(ID == 11 || ID == 52) //Buoy / Mermaid
|
||||||
{
|
|
||||||
defInfo->visitDir = 0xff;
|
|
||||||
blockVisit = true;
|
|
||||||
}
|
|
||||||
else if(ID == 52) //Mermaid
|
|
||||||
{
|
{
|
||||||
blockVisit = true;
|
blockVisit = true;
|
||||||
}
|
}
|
||||||
@ -3065,7 +3060,6 @@ void CGSignBottle::initObj()
|
|||||||
|
|
||||||
if(ID == 59)
|
if(ID == 59)
|
||||||
{
|
{
|
||||||
defInfo->visitDir = 0xff;
|
|
||||||
blockVisit = true;
|
blockVisit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3077,6 +3071,9 @@ void CGSignBottle::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
iw.player = h->getOwner();
|
iw.player = h->getOwner();
|
||||||
iw.text << message;
|
iw.text << message;
|
||||||
cb->showInfoDialog(&iw);
|
cb->showInfoDialog(&iw);
|
||||||
|
|
||||||
|
if(ID == 59)
|
||||||
|
cb->removeObject(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGScholar::giveAnyBonus( const CGHeroInstance * h ) const
|
void CGScholar::giveAnyBonus( const CGHeroInstance * h ) const
|
||||||
@ -3358,7 +3355,6 @@ void CGOnceVisitable::searchTomb(const CGHeroInstance *h, ui32 accept) const
|
|||||||
|
|
||||||
void CGBoat::initObj()
|
void CGBoat::initObj()
|
||||||
{
|
{
|
||||||
defInfo->visitDir = 0xff;
|
|
||||||
hero = NULL;
|
hero = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1354,7 +1354,9 @@ void Mapa::readDefInfo( unsigned char * bufor, int &i)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
vinya->visitDir = 0xff;
|
vinya->visitDir = 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
if(vinya->id == 26)
|
if(vinya->id == 26)
|
||||||
std::memset(vinya->blockMap,255,6);
|
std::memset(vinya->blockMap,255,6);
|
||||||
|
@ -1951,7 +1951,7 @@ bool CGameHandler::garrisonSwap( si32 tid )
|
|||||||
bool CGameHandler::swapArtifacts( si32 hid1, si32 hid2, ui16 slot1, ui16 slot2 )
|
bool CGameHandler::swapArtifacts( si32 hid1, si32 hid2, ui16 slot1, ui16 slot2 )
|
||||||
{
|
{
|
||||||
CGHeroInstance *h1 = gs->getHero(hid1), *h2 = gs->getHero(hid2);
|
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;
|
return false;
|
||||||
|
|
||||||
const CArtifact *a1 = h1->getArt(slot1),
|
const CArtifact *a1 = h1->getArt(slot1),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user