From 1d6e265e3450531dcb69bdfc9fd2111ba2162046 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sun, 9 Mar 2014 12:33:26 +0000 Subject: [PATCH] - Fixed special spells spawning in Pyramid - Allowed new spells to spawn in Pyramid --- lib/GameConstants.h | 2 +- lib/mapping/MapFormatH3M.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/GameConstants.h b/lib/GameConstants.h index 85e54ec72..fcc6b1469 100644 --- a/lib/GameConstants.h +++ b/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) diff --git a/lib/mapping/MapFormatH3M.cpp b/lib/mapping/MapFormatH3M.cpp index 0c034d1d9..fdf67e0ff 100644 --- a/lib/mapping/MapFormatH3M.cpp +++ b/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()