Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/slot.cc')
-rw-r--r--src/core/slot.cc39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/core/slot.cc b/src/core/slot.cc
index 58bb51c..8907097 100644
--- a/src/core/slot.cc
+++ b/src/core/slot.cc
@@ -13,16 +13,35 @@ namespace core
Slot::Slot()
{
+ clear();
+}
+
+Slot::~Slot()
+{
+}
+
+void Slot::load(const model::Slot *slot_tag, const float modelscale)
+{
+ if (slot_tag) {
+ set_type(slot_tag->type());
+ set_location(slot_tag->location() * modelscale);
+ set_axis(slot_tag->axis());
+ set_radius(slot_tag->radius());
+ set_cone(slot_tag->cone() * M_PI / 180.0f);
+ } else {
+ Slot();
+ }
+}
+
+void Slot::clear()
+{
slot_item = 0;
slot_flags = 0;
slot_timestamp = 0;
slot_last_fired = 0;
slot_cone = 0;
- slot_type = model::Weapon::Cannon;
-}
-
-Slot::~Slot()
-{
+ slot_radius = 1.0f;
+ slot_type = model::Slot::None;
}
void Slot::set_flag(const Flags flag)
@@ -43,14 +62,4 @@ void Slot::set_item(Item *item)
set_timestamp(game() ? game()->timestamp() : 1);
}
-void Slot::load(const model::Weapon * weapon_tag)
-{
- if (weapon_tag) {
- set_type(weapon_tag->type());
- set_cone(weapon_tag->cone() * M_PI / 180.0f);
- set_location(weapon_tag->location());
- set_axis(weapon_tag->axis());
- }
-}
-
} // namespace core