Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 12, 2011, 1:09:42 PM (14 years ago)
Author:
landauf
Message:

disabled suicide for Spectator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/pawns/Spectator.cc

    r7862 r7863  
    4343{
    4444    extern const std::string __CC_fire_name;
     45    extern const std::string __CC_suicide_name;
    4546
    4647    CreateFactory(Spectator);
     
    154155
    155156    /**
    156         @brief Changes the keybind mode of the fire command to OnPress.
     157        @brief Changes the behavior of some console commands.
    157158    */
    158159    void Spectator::startLocalHumanControl()
     
    162163        // change keybind mode of fire command to OnPress to avoid firing after respawn
    163164        ModifyConsoleCommand(__CC_fire_name).keybindMode(KeybindMode::OnPress);
     165
     166        // disable suicide
     167        ModifyConsoleCommand(__CC_suicide_name).pushFunction(&prototype::void__void);
    164168    }
    165169
    166170    /**
    167         @brief Changes the keybind mode of the fire command back to OnHold.
     171        @brief Changes the behavior of some console commands back to the original state.
    168172    */
    169173    void Spectator::stopLocalHumanControl()
     
    174178        // as soon as the player releases and presses the button again, the helper function will be called which changes the keybind mode back to OnHold
    175179        ModifyConsoleCommand(__CC_fire_name).pushFunction(&Spectator::resetFireCommand).keybindMode(KeybindMode::OnPress);
     180
     181        // enable suicide
     182        ModifyConsoleCommand(__CC_suicide_name).popFunction();
    176183    }
    177184
Note: See TracChangeset for help on using the changeset viewer.