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

Summon boat for real boats only

This commit is contained in:
nordsoft 2023-04-18 22:21:26 +04:00
parent 1c66cd221d
commit 59a1a19d4a

View File

@ -185,7 +185,7 @@ ESpellCastResult SummonBoatMechanics::applyAdventureEffects(SpellCastEnvironment
if(obj && obj->ID == Obj::TRANSPORT)
{
const auto * b = dynamic_cast<const CGBoat *>(obj);
if(b->hero)
if(b->hero || b->layer != EPathfindingLayer::SAIL)
continue; //we're looking for unoccupied boat
double nDist = b->pos.dist2d(parameters.caster->getHeroCaster()->visitablePos());