From 2c98d3eef488233b99a76ca44d69c1c9d53404af Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 7 Dec 2014 16:12:49 +0000 Subject: 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. --- src/game/base/platform.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/game/base/platform.cc') 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; -- cgit v1.2.3