예제 #1
0
 bool collidecamera()
 {
     switch(player1->state)
     {
         case CS_EDITING: return false;
         case CS_SPECTATOR: return followingplayer()!=NULL;
     }
     return true;
 }
예제 #2
0
 void setupcamera()
 {
     fpsent *target = followingplayer();
     if(target) 
     {
         player1->yaw = target->yaw;    // Kripken: needed?
         player1->pitch = target->state==CS_DEAD ? 0 : target->pitch; // Kripken: needed?
         player1->o = target->o;
         player1->resetinterp();
     }
 }
예제 #3
0
파일: fps.cpp 프로젝트: harryd/ez-mod
    int savedammo[NUMGUNS];

    bool clientoption(const char *arg) { return false; }

    void taunt()
    {
        if(player1->state!=CS_ALIVE || player1->physstate<PHYS_SLOPE) return;
        if(lastmillis-player1->lasttaunt<1000) return;
        player1->lasttaunt = lastmillis;
        addmsg(N_TAUNT, "rc", player1);
    }
    COMMAND(taunt, "");

    ICOMMAND(getfollow, "", (),
    {
        fpsent *f = followingplayer();
        intret(f ? f->clientnum : -1);
    });

	void follow(char *arg)
    {
        if(arg[0] ? player1->state==CS_SPECTATOR : following>=0)
        {
            following = arg[0] ? parseplayer(arg) : -1;
            if(following==player1->clientnum) following = -1;
            followdir = 0;
            conoutf("follow %s", following>=0 ? "on" : "off");
        }
	}
    COMMAND(follow, "s");
예제 #4
0
 fpsent *hudplayer()
 {
     if(thirdperson) return player1;
     fpsent *target = followingplayer();
     return target ? target : player1;
 }
예제 #5
0
    {
        if(!specmode) stopfollowing();
        else if(following < 0) nextfollow();
    });

    gameent *followingplayer()
    {
        if(player1->state!=CS_SPECTATOR || following<0) return NULL;
        gameent *target = getclient(following);
        if(target && target->state!=CS_SPECTATOR) return target;
        return NULL;
    }

    ICOMMAND(getfollow, "", (),
    {
        gameent *f = followingplayer();
        intret(f ? f->clientnum : -1);
    });

    void stopfollowing()
    {
        if(following<0) return;
        following = -1;
    }

    void follow(char *arg)
    {
        int cn = -1;
        if(arg[0])
        {
            if(player1->state != CS_SPECTATOR) return;