diff options
author | Stijn Buys <ingar@osirion.org> | 2014-12-07 16:12:49 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2014-12-07 16:12:49 +0000 |
commit | 2c98d3eef488233b99a76ca44d69c1c9d53404af (patch) | |
tree | 9259bad9533d1de7381b291eee19fd319b8366eb /src/game/base/platform.cc | |
parent | acb236d0df275394095ab43e8519aebc4811865d (diff) |
Cleanup of the slots code, unified model weapon and dock tags into a single slots list,
load dock tags into entity slots, represent entity slot locations in entity coordinate space,
have r_slots render fixed-size slot indicators regardless of model scale.
Diffstat (limited to 'src/game/base/platform.cc')
-rw-r--r-- | src/game/base/platform.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/game/base/platform.cc b/src/game/base/platform.cc index 77059ae..bfad7ef 100644 --- a/src/game/base/platform.cc +++ b/src/game/base/platform.cc @@ -88,17 +88,15 @@ void Platform::frame(const unsigned long elapsed) // platforms do not need weapons in inventory to fire if (enemylist.size()) { - const float modelscale = radius() / (model() ? model()->radius() : 1.0f); - - for (core::Slots::iterator it = slots()->begin(); it != slots()->end(); it++) { - core::Slot *slot = (*it); + for (core::Slots::iterator slit = slots()->begin(); slit != slots()->end(); slit++) { + core::Slot *slot = (*slit); // found out if this slot is a cannon or a turret const Weapon *weapon = 0; - if (slot->type() == model::Weapon::Cannon) { + if (slot->type() == model::Slot::Cannon) { weapon = cannon(); - } else if (slot->type() == model::Weapon::Turret) { + } else if (slot->type() == model::Slot::Turret) { weapon = turret(); } @@ -111,7 +109,7 @@ void Platform::frame(const unsigned long elapsed) } // location of the slot in world coordinates - const math::Vector3f slot_location(location() + (axis() * slot->location() * modelscale)); + const math::Vector3f slot_location(location() + (axis() * slot->location())); // find a target for this slot Ship *current_enemy = 0; |