Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/template.cc')
-rw-r--r--src/game/base/template.cc43
1 files changed, 28 insertions, 15 deletions
diff --git a/src/game/base/template.cc b/src/game/base/template.cc
index a2bf66c..03adc20 100644
--- a/src/game/base/template.cc
+++ b/src/game/base/template.cc
@@ -62,6 +62,9 @@ void Template::print() const {
// set secondary color
if (has_color_second())
con_print << " primary color " << color_second() << std::endl;
+
+ if (maxarmor())
+ con_print << " armor " << maxarmor() << std::endl;
}
void Template::list()
@@ -105,6 +108,11 @@ bool Template::got_template_key(filesystem::IniFile &inifile, Template *entityte
} else if (inifile.got_key_float("radius", floatvalue)) {
entitytemplate->set_radius(floatvalue);
return true;
+
+ } else if (inifile.got_key_float("armor", floatvalue)) {
+ entitytemplate->set_maxarmor(floatvalue);
+ return true;
+
} else {
return false;
}
@@ -215,6 +223,7 @@ Template::Template() :
template_radius = 0;
template_has_color = false;
template_has_color_second = false;
+ template_maxarmor = 0;
}
Template::~Template()
@@ -238,23 +247,27 @@ void Template::set_color_second(const math::Color &color_second)
template_has_color_second = true;
}
+void Template::set_maxarmor(const float maxarmor)
+{
+ template_maxarmor = maxarmor;
+}
void Template::apply(core::Entity *entity) const
{
- // set radius
- if (radius())
- entity->set_radius(radius());
-
- // set modelname
- if (modelname().size())
- entity->set_modelname(modelname());
-
- // set primary color
- if (has_color())
- entity->set_color(color());
-
- // set secondary color
- if (has_color_second())
- entity->set_color_second(color_second());
+ // set radius
+ if (radius())
+ entity->set_radius(radius());
+
+ // set modelname
+ if (modelname().size())
+ entity->set_modelname(modelname());
+
+ // set primary color
+ if (has_color())
+ entity->set_color(color());
+
+ // set secondary color
+ if (has_color_second())
+ entity->set_color_second(color_second());
}
} // namespace game