Browse Source

Fixed #178 = Scholar won't give unavaliable spells anymore.

DjWarmonger 16 years ago
parent
commit
f0e04ad850
1 changed files with 4 additions and 1 deletions
  1. 4 1
      hch/CObjectHandler.cpp

+ 4 - 1
hch/CObjectHandler.cpp

@@ -3767,7 +3767,10 @@ void CGScholar::initObj()
 			bonusID = ran() % SKILL_QUANTITY;
 			break;
 		case 2:
-			bonusID = ran() % SPELLS_QUANTITY;
+			std::vector<ui16> possibilities;
+			for (int i = 1; i < 6; ++i)
+				cb->getAllowedSpells (possibilities, i);
+			bonusID = possibilities[ran() % possibilities.size()];
 			break;
 		}
 	}