@@ -60,7 +60,7 @@ YAML::Emitter& operator<< (YAML::Emitter& out, const UnitStats& stats)
6060 * @param race String defining the race.
6161 * @param rank String defining the rank.
6262 */
63- Unit::Unit (const std::string &type, std::string race, std::string rank) : _type(type), _race(race), _rank(rank), _stats(), _armor(" " ), _standHeight(0 ), _kneelHeight(0 ), _loftemps (0 ), _value(0 ), _deathSound(0 ), _aggroSound(0 ), _moveSound(-1 ), _intelligence(0 ), _aggression(0 ), _specab(SPECAB_NONE ), _zombieUnit(" " ), _spawnUnit(" " )
63+ Unit::Unit (const std::string &type, std::string race, std::string rank) : _type(type), _race(race), _rank(rank), _stats(), _armor(" " ), _standHeight(0 ), _kneelHeight(0 ), _loftempsSet (0 ), _value(0 ), _deathSound(0 ), _aggroSound(0 ), _moveSound(-1 ), _intelligence(0 ), _aggression(0 ), _specab(SPECAB_NONE ), _zombieUnit(" " ), _spawnUnit(" " )
6464{
6565}
6666
@@ -114,7 +114,13 @@ void Unit::load(const YAML::Node &node)
114114 }
115115 else if (key == " loftemps" )
116116 {
117- i.second () >> _loftemps;
117+ int a;
118+ i.second () >> a;
119+ _loftempsSet.push_back (a);
120+ }
121+ else if (key == " loftempsSet" )
122+ {
123+ i.second () >> _loftempsSet;
118124 }
119125 else if (key == " value" )
120126 {
@@ -170,7 +176,14 @@ void Unit::save(YAML::Emitter &out) const
170176 out << YAML ::Key << " armor" << YAML ::Value << _armor;
171177 out << YAML ::Key << " standHeight" << YAML ::Value << _standHeight;
172178 out << YAML ::Key << " kneelHeight" << YAML ::Value << _kneelHeight;
173- out << YAML ::Key << " loftemps" << YAML ::Value << _loftemps;
179+ if (_loftempsSet.size () == 1 )
180+ {
181+ out << YAML ::Key << " loftemps" << YAML ::Value << _loftempsSet.front ();
182+ }
183+ else
184+ {
185+ out << YAML ::Key << " loftempsSet" << YAML ::Value << _loftempsSet;
186+ }
174187 out << YAML ::Key << " value" << YAML ::Value << _value;
175188 out << YAML ::Key << " deathSound" << YAML ::Value << _deathSound;
176189 out << YAML ::Key << " aggroSound" << YAML ::Value << _aggroSound;
@@ -224,11 +237,15 @@ int Unit::getKneelHeight() const
224237 * Returns the unit's 3D template ID.
225238 * @return template ID.
226239 */
227- int Unit::getLoftemps () const
240+ int Unit::getLoftemps (int entry ) const
228241{
229- return _loftemps ;
242+ return _loftempsSet. at (entry) ;
230243}
231244
245+ std::vector<int > Unit::getLoftempsSet () const
246+ {
247+ return _loftempsSet;
248+ }
232249/* *
233250 * Gets the unit's armor type.
234251 * @return string.
0 commit comments