mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
VCAI: more work on teleport exit probing
This commit is contained in:
parent
2f9ca778b2
commit
ee08749743
@ -641,10 +641,10 @@ void VCAI::showTeleportDialog(TeleportChannelID channel, TTeleportExitsList exit
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// FIXME: This code generate "Object is not visible." errors
|
// TODO: Implement checking if visiting that teleport will uncovert any FoW
|
||||||
// What is better way to check that certain teleport exit wasn't visited yet or not visible?
|
// So far this is the best option to handle decision about probing
|
||||||
if(!vstd::contains(visitableObjs, cb->getObj(exit.first)) &&
|
auto obj = cb->getObj(exit.first, false);
|
||||||
!vstd::contains(teleportChannelProbingList, exit.first) &&
|
if(obj == nullptr && !vstd::contains(teleportChannelProbingList, exit.first) &&
|
||||||
exit.first != destinationTeleport)
|
exit.first != destinationTeleport)
|
||||||
{
|
{
|
||||||
teleportChannelProbingList.push_back(exit.first);
|
teleportChannelProbingList.push_back(exit.first);
|
||||||
@ -1877,7 +1877,8 @@ bool VCAI::moveHeroToTile(int3 dst, HeroPtr h)
|
|||||||
auto doTeleportMovement = [&](ObjectInstanceID exitId, int3 exitPos)
|
auto doTeleportMovement = [&](ObjectInstanceID exitId, int3 exitPos)
|
||||||
{
|
{
|
||||||
destinationTeleport = exitId;
|
destinationTeleport = exitId;
|
||||||
destinationTeleportPos = CGHeroInstance::convertPosition(exitPos, true);
|
if(exitPos.valid())
|
||||||
|
destinationTeleportPos = CGHeroInstance::convertPosition(exitPos, true);
|
||||||
cb->moveHero(*h, h->pos);
|
cb->moveHero(*h, h->pos);
|
||||||
destinationTeleport = ObjectInstanceID();
|
destinationTeleport = ObjectInstanceID();
|
||||||
destinationTeleportPos = int3();
|
destinationTeleportPos = int3();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user