Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 12, 2011, 11:57:28 AM (13 years ago)
Author:
landauf
Message:

added feature to Spectator which changes the keybind mode of the fire command to OnPress if the player controls a Spectator. changes mode back to OnHold if the player stops control of the Spectator (e.g. spawns) by using a helper function.

This avoids accidentally firing the weapons right after spawn.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/controllers/HumanController.cc

    r7533 r7862  
    4040namespace orxonox
    4141{
     42    extern const std::string __CC_fire_name = "fire";
     43
    4244    SetConsoleCommand("HumanController", "moveFrontBack",          &HumanController::moveFrontBack ).addShortcut().setAsInputCommand();
    4345    SetConsoleCommand("HumanController", "moveRightLeft",          &HumanController::moveRightLeft ).addShortcut().setAsInputCommand();
     
    4648    SetConsoleCommand("HumanController", "rotatePitch",            &HumanController::rotatePitch   ).addShortcut().setAsInputCommand();
    4749    SetConsoleCommand("HumanController", "rotateRoll",             &HumanController::rotateRoll    ).addShortcut().setAsInputCommand();
    48     SetConsoleCommand("HumanController", "fire",                   &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
     50    SetConsoleCommand("HumanController", __CC_fire_name,           &HumanController::fire          ).addShortcut().keybindMode(KeybindMode::OnHold);
    4951    SetConsoleCommand("HumanController", "reload",                 &HumanController::reload        ).addShortcut();
    5052    SetConsoleCommand("HumanController", "boost",                  &HumanController::boost         ).addShortcut().keybindMode(KeybindMode::OnHold);
Note: See TracChangeset for help on using the changeset viewer.