2017-03-17 17:48:44 +02:00
|
|
|
/*
|
|
|
|
* SideInBattle.cpp, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
2017-07-01 20:05:10 +02:00
|
|
|
#include "StdInc.h"
|
2017-03-17 17:48:44 +02:00
|
|
|
#include "SideInBattle.h"
|
2017-06-29 01:02:05 +02:00
|
|
|
#include "../mapObjects/CArmedInstance.h"
|
2017-03-17 17:48:44 +02:00
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2017-06-29 01:02:05 +02:00
|
|
|
void SideInBattle::init(const CGHeroInstance * Hero, const CArmedInstance * Army)
|
2017-03-17 17:48:44 +02:00
|
|
|
{
|
|
|
|
hero = Hero;
|
|
|
|
armyObject = Army;
|
|
|
|
color = armyObject->getOwner();
|
|
|
|
|
2023-07-24 21:21:15 +02:00
|
|
|
if(armyObject->ID == Obj::CREATURE_GENERATOR1
|
|
|
|
|| armyObject->ID == Obj::CREATURE_GENERATOR2
|
|
|
|
|| armyObject->ID == Obj::CREATURE_GENERATOR3
|
|
|
|
|| armyObject->ID == Obj::CREATURE_GENERATOR4)
|
|
|
|
{
|
|
|
|
color = PlayerColor::NEUTRAL;
|
|
|
|
}
|
|
|
|
|
2017-03-17 17:48:44 +02:00
|
|
|
if(color == PlayerColor::UNFLAGGABLE)
|
|
|
|
color = PlayerColor::NEUTRAL;
|
|
|
|
}
|
2022-07-26 15:07:42 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|