mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
* Added Blind to CCreatureHandler::getMindSpells()
* Fixed Angelic Alliance to the right factions. * Added functions to determine good/evil status of a unit/faction. Was going to use it for both Evil Fog/Holy Ground and Angelic Alliance, but turned out the latter was a bit special. Could still be useful in the future with additional towns. CCreatureHandler seemed to be the best place for it.
This commit is contained in:
@ -858,12 +858,12 @@ std::vector<std::pair<int,std::string> > CGHeroInstance::getCurrentMoraleModifie
|
||||
std::set<si8> factions;
|
||||
for(std::map<si32,std::pair<ui32,si32> >::const_iterator i=army.slots.begin(); i!=army.slots.end(); i++)
|
||||
{
|
||||
// Take Angelic Alliance troop-mixing freedom into account.
|
||||
si8 faction = VLC->creh->creatures[i->second.first].faction;
|
||||
// Take Angelic Alliance troop-mixing freedom of non-evil, non-Conflux units into account.
|
||||
const si8 faction = VLC->creh->creatures[i->second.first].faction;
|
||||
if (hasBonusOfType(HeroBonus::NONEVIL_ALIGNMENT_MIX)
|
||||
&& (faction <= 2 || faction == 6 || faction == 8))
|
||||
&& ((faction >= 0 && faction <= 2) || faction == 6 || faction == 7))
|
||||
{
|
||||
factions.insert(0); // Insert any non-evil alignment as arbitrary single faction, in this case Castle.
|
||||
factions.insert(0); // Insert a single faction of the affected group, Castle will do.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user