Browse Source

- Fixed special spells spawning in Pyramid
- Allowed new spells to spawn in Pyramid

DjWarmonger 11 years ago
parent
commit
1d6e265e34
2 changed files with 8 additions and 3 deletions
  1. 1 1
      lib/GameConstants.h
  2. 7 2
      lib/mapping/MapFormatH3M.cpp

+ 1 - 1
lib/GameConstants.h

@@ -864,7 +864,7 @@ public:
 		STONE_GAZE=70, POISON=71, BIND=72, DISEASE=73, PARALYZE=74, AGE=75, DEATH_CLOUD=76, THUNDERBOLT=77,
 		DISPEL_HELPFUL_SPELLS=78, DEATH_STARE=79, ACID_BREATH_DEFENSE=80, ACID_BREATH_DAMAGE=81,
 
-		AFTER_LAST = 82
+		FIRST_NON_SPELL = 70, AFTER_LAST = 82
 	};
 
 	SpellID(ESpellID _num = NONE) : num(_num)

+ 7 - 2
lib/mapping/MapFormatH3M.cpp

@@ -690,8 +690,8 @@ void CMapLoaderH3M::readAllowedArtifacts()
 
 void CMapLoaderH3M::readAllowedSpellsAbilities()
 {
-	// Read allowed spells
-	map->allowedSpell.resize(GameConstants::SPELLS_QUANTITY, true);
+	// Read allowed spells, including new ones
+	map->allowedSpell.resize(VLC->spellh->objects.size(), true);
 
 	// Read allowed abilities
 	map->allowedAbilities.resize(GameConstants::SKILL_QUANTITY, true);
@@ -706,6 +706,11 @@ void CMapLoaderH3M::readAllowedSpellsAbilities()
 		const int abil_bytes = 4;
 		readBitmask(map->allowedAbilities, abil_bytes, GameConstants::SKILL_QUANTITY);
 	}
+
+	//do not generate special abilities and spells
+	for (auto spell : VLC->spellh->objects)
+		if (spell->isSpecialSpell() || spell->isCreatureAbility())
+			map->allowedSpell[spell->id] = false;
 }
 
 void CMapLoaderH3M::readRumors()