Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 9, 2009, 3:18:11 AM (16 years ago)
Author:
landauf
Message:

Several small adjustments in the weaponsystem (like additional const keyword, includes moved from .h to .cc where possible, …)

Firemode is now an unsigned int instead of an Enum. Instead of "fire" and "altFire" use "fire 0" and "fire 1"

Location:
code/branches/weapons/src/orxonox/objects/controllers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapons/src/orxonox/objects/controllers/AIController.cc

    r2896 r2912  
    111111
    112112        if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(500) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
    113             this->getControllableEntity()->fire(WeaponMode::fire);
     113            this->getControllableEntity()->fire(0);
    114114
    115115        SUPER(AIController, tick, dt);
  • code/branches/weapons/src/orxonox/objects/controllers/HumanController.cc

    r2872 r2912  
    4646    SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
    4747    SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
    48     SetConsoleCommand(HumanController, altFire,       true).keybindMode(KeybindMode::OnHold);
    4948    SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
    5049    SetConsoleCommand(HumanController, greet,         true);
     
    109108    }
    110109
    111     void HumanController::fire()
     110    void HumanController::fire(unsigned int firemode)
    112111    {
    113112        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    114             HumanController::localController_s->controllableEntity_->fire(WeaponMode::fire);
    115     }
    116 
    117     void HumanController::altFire()
    118     {
    119         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    120             HumanController::localController_s->controllableEntity_->fire(WeaponMode::altFire);
     113            HumanController::localController_s->controllableEntity_->fire(firemode);
    121114    }
    122115
  • code/branches/weapons/src/orxonox/objects/controllers/HumanController.h

    r2662 r2912  
    5151            static void rotateRoll(const Vector2& value);
    5252
    53             static void fire();
    54             static void altFire();
     53            static void fire(unsigned int firemode);
    5554
    5655            static void boost();
Note: See TracChangeset for help on using the changeset viewer.