1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Put Warrior's Tomb into the switch statement and properly set the sound returned.

This commit is contained in:
Frank Zago
2012-06-07 03:02:30 +00:00
parent 534c9142ac
commit bc4f856bfc

View File

@ -5554,8 +5554,9 @@ ui8 CGGarrison::getPassableness() const
void CGOnceVisitable::onHeroVisit( const CGHeroInstance * h ) const void CGOnceVisitable::onHeroVisit( const CGHeroInstance * h ) const
{ {
int sound = 0; int sound;
int txtid = -1; int txtid;
switch(ID) switch(ID)
{ {
case 22: //Corpse case 22: //Corpse
@ -5570,23 +5571,21 @@ void CGOnceVisitable::onHeroVisit( const CGHeroInstance * h ) const
sound = soundBase::GENIE; sound = soundBase::GENIE;
txtid = 154; txtid = 154;
break; break;
case 108: case 108://Warrior's Tomb
break;
default:
tlog1 << "Error: Unknown object (" << ID <<") treated as CGOnceVisitable!\n";
return;
}
if(ID == 108)//Warrior's Tomb
{ {
//ask if player wants to search the Tomb //ask if player wants to search the Tomb
BlockingDialog bd(true, false); BlockingDialog bd(true, false);
sound = soundBase::GRAVEYARD; bd.soundID = soundBase::GRAVEYARD;
bd.player = h->getOwner(); bd.player = h->getOwner();
bd.text.addTxt(MetaString::ADVOB_TXT,161); bd.text.addTxt(MetaString::ADVOB_TXT,161);
cb->showBlockingDialog(&bd,boost::bind(&CGOnceVisitable::searchTomb,this,h,_1)); cb->showBlockingDialog(&bd,boost::bind(&CGOnceVisitable::searchTomb,this,h,_1));
return; return;
} }
break;
default:
tlog1 << "Error: Unknown object (" << ID <<") treated as CGOnceVisitable!\n";
return;
}
InfoWindow iw; InfoWindow iw;
iw.soundID = sound; iw.soundID = sound;