mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-05 13:04:54 +02:00
Real fix for #328
This commit is contained in:
parent
c1cb2c223f
commit
b8edea2be9
@ -2764,7 +2764,8 @@ void CGTeleport::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
break;
|
break;
|
||||||
case 103: //find nearest subterranean gate on the other level
|
case 103: //find nearest subterranean gate on the other level
|
||||||
{
|
{
|
||||||
for(int i=0; i < gates.size(); i++)
|
int i=0;
|
||||||
|
for(; i < gates.size(); i++)
|
||||||
{
|
{
|
||||||
if(gates[i].first == id)
|
if(gates[i].first == id)
|
||||||
{
|
{
|
||||||
@ -2777,6 +2778,14 @@ void CGTeleport::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(destinationid < 0 || i == gates.size()) //no exit
|
||||||
|
{
|
||||||
|
InfoWindow iw;
|
||||||
|
iw.player = h->tempOwner;
|
||||||
|
iw.text.addTxt(MetaString::ADVOB_TXT, 153); //Just inside the entrance you find a large pile of rubble blocking the tunnel. You leave discouraged.
|
||||||
|
cb->sendAndApply(&iw);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2830,8 +2839,15 @@ void CGTeleport::postInit() //matches subterranean gates into pairs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gates.push_back(std::pair<int, int>(cur->id, gatesSplit[1][best.first]->id));
|
if(best.first >= 0) //found pair
|
||||||
gatesSplit[1][best.first] = NULL;
|
{
|
||||||
|
gates.push_back(std::pair<int, int>(cur->id, gatesSplit[1][best.first]->id));
|
||||||
|
gatesSplit[1][best.first] = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gates.push_back(std::pair<int, int>(cur->id, -1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user