소스 검색

#3788 - fix passing wirlpool with only commander alive

Andrii Danylchenko 1 년 전
부모
커밋
ae69311023
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      lib/mapObjects/MiscObjects.cpp

+ 2 - 1
lib/mapObjects/MiscObjects.cpp

@@ -709,7 +709,8 @@ void CGWhirlpool::teleportDialogAnswered(const CGHeroInstance *hero, ui32 answer
 bool CGWhirlpool::isProtected(const CGHeroInstance * h)
 {
 	return h->hasBonusOfType(BonusType::WHIRLPOOL_PROTECTION)
-	|| (h->stacksCount() == 1 && h->Slots().begin()->second->count == 1);
+		|| (h->stacksCount() == 1 && h->Slots().begin()->second->count == 1)
+		|| (h->stacksCount() == 0 && h->commander && h->commander->alive);
 }
 
 ArtifactID CGArtifact::getArtifact() const