소스 검색

don't add Necromancy to Witch Hut on random maps

Andrey Filipenkov 3 년 전
부모
커밋
b26db479d7
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      lib/mapObjects/MiscObjects.cpp

+ 3 - 1
lib/mapObjects/MiscObjects.cpp

@@ -1452,8 +1452,10 @@ void CGWitchHut::initObj(CRandomGenerator & rand)
 {
 {
 	if (allowedAbilities.empty()) //this can happen for RMG. regular maps load abilities from map file
 	if (allowedAbilities.empty()) //this can happen for RMG. regular maps load abilities from map file
 	{
 	{
+		// Necromancy can't be learned on random maps
 		for(int i = 0; i < VLC->skillh->size(); i++)
 		for(int i = 0; i < VLC->skillh->size(); i++)
-			allowedAbilities.push_back(i);
+			if(VLC->skillh->getByIndex(i)->getId() != SecondarySkill::NECROMANCY)
+				allowedAbilities.push_back(i);
 	}
 	}
 	ability = *RandomGeneratorUtil::nextItem(allowedAbilities, rand);
 	ability = *RandomGeneratorUtil::nextItem(allowedAbilities, rand);
 }
 }