1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

Fixes for handling starting spells / spellbook.

This commit is contained in:
Michał W. Urbańczyk
2009-09-13 22:45:58 +00:00
parent efb1049860
commit 670a408fab
2 changed files with 15 additions and 6 deletions

View File

@ -660,12 +660,16 @@ void CGHeroInstance::initHero()
initHeroDefInfo();
if(!type)
type = VLC->heroh->heroes[subID];
artifWorn[16] = 3;
if(type->startingSpell >= 0) //hero starts with a spell
{
artifWorn[17] = 0; //give him spellbook
if(!vstd::contains(spells, 0xffffffff) && type->startingSpell >= 0) //hero starts with a spell
spells.insert(type->startingSpell);
else //remove placeholder
spells -= 0xffffffff;
if(!vstd::contains(artifWorn, 16) && type->startingSpell >= 0) //no catapult means we haven't read pre-existant set
{
artifWorn[17] = 0; //give spellbook
}
artifWorn[16] = 3; //everyone has a catapult
if(portrait < 0 || portrait == 255)
portrait = subID;