components/prboom/p_spec.c
/////////////////////////////
//
// Add a push thinker to the thinker list
Add a push thinker to the thinker list
Add a push thinker to the thinker list
static void Add_Pusher(int type, int x_mag, int y_mag, mobj_t* source, int affectee)
    {
    pusher_t *p = Z_Malloc(sizeof *p, PU_LEVSPEC, 0);
    p->thinker.function = T_Pusher;
    p->source = source;
    p->type = type;
    p->x_mag = x_mag>>FRACBITS;
    p->y_mag = y_mag>>FRACBITS;
    p->magnitude = P_AproxDistance(p->x_mag,p->y_mag);
    if (source) 
        {
        p->radius = (p->magnitude)<<(FRACBITS+1); 
        p->x = p->source->x;
        p->y = p->source->y;
        }
    p->affectee = affectee;
    P_AddThinker(&p->thinker);
    }
static void Add_Pusher ( int type , int x_mag , int y_mag , mobj_t * source , int affectee ) { pusher_t * p = Z_Malloc ( sizeof * p , PU_LEVSPEC , 0 ) ; p -> thinker . function = T_Pusher ; p -> source = source ; p -> type = type ; p -> x_mag = x_mag >> FRACBITS ; p -> y_mag = y_mag >> FRACBITS ; p -> magnitude = P_AproxDistance ( p -> x_mag , p -> y_mag ) ; if ( source ) { p -> radius = ( p -> magnitude ) << ( FRACBITS + 1 ) ; p -> x = p -> source -> x ; p -> y = p -> source -> y ; } p -> affectee = affectee ; P_AddThinker ( & p -> thinker ) ; }
Add a push thinker to the thinker list
Add a push thinker to the thinker list
// point source exist? // where force goes to zero