Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 15, 2010, 2:57:51 PM (14 years ago)
Author:
gnadler
Message:

Cant assign Pawn* to WeakPtr<Pawn>.

Location:
code/branches/rocket/src/modules/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/modules/weapons/RocketController.cc

    r6902 r6903  
    6464
    6565        SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity());
    66                 rocket->rotatePitch(0.005);
    67                 rocket->setVelocity(rocket->getVelocity()*1.02);
     66                if (this->target_) {
     67                rocket->rotatePitch(0.5);
     68                rocket->rotateYaw(0.5);
     69                }
     70                rocket->setVelocity(rocket->getVelocity()*1.03);
    6871       
    6972        }
     
    7780
    7881
     82        void RocketController::setTarget(Pawn* target) {
     83                this->target_ = target;
     84        }
     85
     86
     87
    7988
    8089}
  • code/branches/rocket/src/modules/weapons/RocketController.h

    r6863 r6903  
    5353            virtual void tick(float dt);
    5454                        SimpleRocket* getRocket(){return this->rocket;};
     55                        void setTarget(Pawn* target);
    5556        protected:
    5657
     
    6061                        WeakPtr<PlayerInfo> player_;
    6162                                                int haha;
     63                        WeakPtr<Pawn> target_;
    6264
    6365
Note: See TracChangeset for help on using the changeset viewer.