Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2010, 11:35:18 AM (14 years ago)
Author:
dafrick
Message:

Documenting in pickups module.
Cleaning up in PickupManager.
Removed some obsolete functions in HumanController and ControllableEntity, which were remenants of the old pickups module.
Fixed a bug.

Location:
code/trunk/src/orxonox
Files:
5 edited

Legend:

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

    r7284 r7533  
    5656    SetConsoleCommand("HumanController", "addBots",                &HumanController::addBots       ).addShortcut().defaultValues(1);
    5757    SetConsoleCommand("HumanController", "killBots",               &HumanController::killBots      ).addShortcut().defaultValues(0);
    58     SetConsoleCommand("HumanController", "dropItems",              &HumanController::dropItems     ).addShortcut();
    59     SetConsoleCommand("HumanController", "useItem",                &HumanController::useItem       ).addShortcut();
    6058    SetConsoleCommand("HumanController", "cycleNavigationFocus",   &HumanController::cycleNavigationFocus).addShortcut();
    6159    SetConsoleCommand("HumanController", "releaseNavigationFocus", &HumanController::releaseNavigationFocus).addShortcut();
     
    202200    }
    203201
    204     void HumanController::useItem()
    205     {
    206         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    207             HumanController::localController_s->controllableEntity_->useItem();
    208     }
    209 
    210202    void HumanController::addBots(unsigned int amount)
    211203    {
     
    218210        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->getGametype())
    219211            HumanController::localController_s->controllableEntity_->getGametype()->killBots(amount);
    220     }
    221 
    222     void HumanController::dropItems()
    223     {
    224         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    225             HumanController::localController_s->controllableEntity_->dropItems();
    226212    }
    227213
  • code/trunk/src/orxonox/controllers/HumanController.h

    r6417 r7533  
    6868            static void switchCamera();
    6969            static void mouseLook();
    70             static void dropItems();
    71             static void useItem();
    7270            static void cycleNavigationFocus();
    7371            static void releaseNavigationFocus();
  • code/trunk/src/orxonox/worldentities/ControllableEntity.cc

    r7502 r7533  
    281281
    282282        this->player_ = player;
     283        this->formerPlayer_ = player;
    283284        this->playerID_ = player->getObjectID();
    284285        this->bHasLocalController_ = player->isLocalPlayer();
  • code/trunk/src/orxonox/worldentities/ControllableEntity.h

    r7163 r7533  
    5555            inline PlayerInfo* getPlayer() const
    5656                { return this->player_; }
     57            /**
     58            @brief Get the player even after the ControllableEntity has stopped being the players ControllableEntity.
     59            @return Returns the most recent PlayerInfo.
     60            */
     61            inline PlayerInfo* getFormerPlayer() const
     62                { return this->formerPlayer_; }
    5763
    5864            inline void setDestroyWhenPlayerLeft(bool bDestroy)
     
    8995            virtual void boost() {}
    9096            virtual void greet() {}
    91             virtual void useItem() {}
    92             virtual void dropItems() {}
    9397            virtual void switchCamera();
    9498            virtual void mouseLook();
     
    204208
    205209            PlayerInfo* player_;
     210            PlayerInfo* formerPlayer_;
    206211            unsigned int playerID_;
    207212
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r7163 r7533  
    248248            this->setDestroyWhenPlayerLeft(false);
    249249
    250             this->dropItems();
    251 
    252250            if (this->getGametype())
    253251                this->getGametype()->pawnKilled(this, this->lastHitOriginator_);
Note: See TracChangeset for help on using the changeset viewer.