mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
REMOVED FILES: CPatgFinder.h/cpp
Updated project files for MSVC and automake (I hope I didn't break it) * Refactored pathfinding and integrated into CGameState. * Fixed issues with wrong calculating movement cost at server side * Hero infowindow won't be redrawed each time experience changes * Removed memory leaks with CPaths-s * Support for Sign objects * Bumped savegame formt version to ensure old not compatible saves won't be readed * Spellscrolls will disappear on visit (won't be treated as spellbooks anymore)
This commit is contained in:
@ -1493,14 +1493,17 @@ void CGArtifact::onHeroVisit( const CGHeroInstance * h ) const
|
||||
{
|
||||
if(!army.slots.size())
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.player = h->tempOwner;
|
||||
iw.components.push_back(Component(4,subID,0,0));
|
||||
if(message.length())
|
||||
iw.text << message;
|
||||
else
|
||||
iw.text << std::pair<ui8,ui32>(12,subID);
|
||||
cb->showInfoDialog(&iw);
|
||||
if(ID == 5)
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.player = h->tempOwner;
|
||||
iw.components.push_back(Component(4,subID,0,0));
|
||||
if(message.length())
|
||||
iw.text << message;
|
||||
else
|
||||
iw.text << std::pair<ui8,ui32>(12,subID);
|
||||
cb->showInfoDialog(&iw);
|
||||
}
|
||||
pick(h);
|
||||
}
|
||||
else
|
||||
@ -1521,7 +1524,14 @@ void CGArtifact::onHeroVisit( const CGHeroInstance * h ) const
|
||||
|
||||
void CGArtifact::pick(const CGHeroInstance * h) const
|
||||
{
|
||||
cb->giveHeroArtifact(subID,h->id,-2);
|
||||
if(ID == 5) //Artifact
|
||||
{
|
||||
cb->giveHeroArtifact(subID,h->id,-2);
|
||||
}
|
||||
else if(ID == 93) // Spell scroll
|
||||
{
|
||||
//TODO: support for the spell scroll
|
||||
}
|
||||
cb->removeObject(id);
|
||||
}
|
||||
|
||||
@ -1996,3 +2006,18 @@ const std::string & CGShrine::getHoverText() const
|
||||
}
|
||||
return hoverName;
|
||||
}
|
||||
|
||||
void CGSignBottle::initObj()
|
||||
{
|
||||
//if no text is set than we pick random from the predefined ones
|
||||
if(!message.size())
|
||||
message = VLC->generaltexth->randsign[ran()%VLC->generaltexth->randsign.size()];
|
||||
}
|
||||
|
||||
void CGSignBottle::onHeroVisit( const CGHeroInstance * h ) const
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.player = h->getOwner();
|
||||
iw.text << message;
|
||||
cb->showInfoDialog(&iw);
|
||||
}
|
Reference in New Issue
Block a user