Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Network

Name: Anonymous 2009-09-04 16:39

       
    WinMain
    {
        while (1)
        {
                newtime = Sys_DoubleTime ();
                time = newtime - oldtime;
                Host_Frame (time)
                {
                    setjmp
                    Sys_SendKeyEvents
                    IN_Commands
                    Cbuf_Execute
                   
                    CL_ReadPackets
                    CL_SendCmd
                   

                    CL_SetUpPlayerPrediction(false)
                    CL_PredictMove
                    CL_SetUpPlayerPrediction(true)
                    CL_EmitEntities
                   
               
                    SCR_UpdateScreen
                }
                oldtime = newtime;
        }
    }

Name: Haxus the First Reply 2009-09-04 16:46

void M_ReactToDamage (edict_t *targ, edict_t *attacker)
{
    if (!(attacker->client) && !(attacker->svflags & SVF_MONSTER))
        return;

    if (attacker == targ || attacker == targ->enemy)
        return;

    // if we are a good guy monster and our attacker is a player
    // or another good guy, do not get mad at them
    if (targ->monsterinfo.aiflags & AI_GOOD_GUY)
    {
        if (attacker->client || (attacker->monsterinfo.aiflags & AI_GOOD_GUY))
            return;
    }

    // we now know that we are not both good guys

    // if attacker is a client, get mad at them because he's good and we're not
    if (attacker->client)
    {
        targ->monsterinfo.aiflags &= ~AI_SOUND_TARGET;

        // this can only happen in coop (both new and old enemies are clients)
        // only switch if can't see the current enemy
        if (targ->enemy && targ->enemy->client)
        {
            if (visible(targ, targ->enemy))
            {
                targ->oldenemy = attacker;
                return;
            }
            targ->oldenemy = targ->enemy;
        }
        targ->enemy = attacker;
        if (!(targ->monsterinfo.aiflags & AI_DUCKED))
            FoundTarget (targ);
        return;
    }

    // it's the same base (walk/swim/fly) type and a different classname and it's not a tank
    // (they spray too much), get mad at them
    if (((targ->flags & (FL_FLY|FL_SWIM)) == (attacker->flags & (FL_FLY|FL_SWIM))) &&
         (strcmp (targ->classname, attacker->classname) != 0) &&
         (strcmp(attacker->classname, "monster_tank") != 0) &&
         (strcmp(attacker->classname, "monster_supertank") != 0) &&
         (strcmp(attacker->classname, "monster_makron") != 0) &&
         (strcmp(attacker->classname, "monster_jorg") != 0) )
    {
        if (targ->enemy && targ->enemy->client)
            targ->oldenemy = targ->enemy;
        targ->enemy = attacker;
        if (!(targ->monsterinfo.aiflags & AI_DUCKED))
            FoundTarget (targ);
    }
    // if they *meant* to shoot us, then shoot back
    else if (attacker->enemy == targ)
    {
        if (targ->enemy && targ->enemy->client)
            targ->oldenemy = targ->enemy;
        targ->enemy = attacker;
        if (!(targ->monsterinfo.aiflags & AI_DUCKED))
            FoundTarget (targ);
    }
    // otherwise get mad at whoever they are mad at (help our buddy) unless it is us!
    else if (attacker->enemy && attacker->enemy != targ)
    {
        if (targ->enemy && targ->enemy->client)
            targ->oldenemy = targ->enemy;
        targ->enemy = attacker->enemy;
        if (!(targ->monsterinfo.aiflags & AI_DUCKED))
            FoundTarget (targ);
    }
}

Name: Anonymous 2009-09-04 17:00

Name: Anonymous 2009-09-04 17:04

>>3
LOLWUT

Name: Anonymous 2009-09-04 18:07

>>1-4
So, what?

Name: Anonymous 2010-12-17 1:37

Erika once told me that Xarn is a bad boyfriend

Name: Anonymous 2011-02-02 22:40

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List