components/prboom/p_spec.c
/////////////////////////////
//
// This is where abnormal friction is applied to objects in the sectors.
// A friction thinker has been spawned for each sector where less or
// more friction should be applied. The amount applied is proportional to
// the length of the controlling linedef.
This is where abnormal friction is applied to objects in the sectors.
A friction thinker has been spawned for each sector where less or
more friction should be applied. The amount applied is proportional to
the length of the controlling linedef.
This is where abnormal friction is applied to objects in the sectors . A friction thinker has been spawned for each sector where less or more friction should be applied . The amount applied is proportional to the length of the controlling linedef .
void T_Friction(friction_t *f)
    {
    sector_t *sec;
    mobj_t   *thing;
    msecnode_t* node;
    if (compatibility || !variable_friction)
        return;
    sec = sectors + f->affectee;
    if (!(sec->special & FRICTION_MASK))
        return;
    node = sec->touching_thinglist; 
    while (node)
        {
        thing = node->m_thing;
        if (thing->player &&
            !(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) &&
            thing->z <= sec->floorheight)
            {
            if ((thing->friction == ORIG_FRICTION) ||     
              (f->friction < thing->friction))
                {
                thing->friction   = f->friction;
                thing->movefactor = f->movefactor;
                }
            }
        node = node->m_snext;
        }
    }
void T_Friction ( friction_t * f ) { sector_t * sec ; mobj_t * thing ; msecnode_t * node ; if ( compatibility || ! variable_friction ) return ; sec = sectors + f -> affectee ; if ( ! ( sec -> special & FRICTION_MASK ) ) return ; node = sec -> touching_thinglist ; while ( node ) { thing = node -> m_thing ; if ( thing -> player && ! ( thing -> flags & ( MF_NOGRAVITY | MF_NOCLIP ) ) && thing -> z <= sec -> floorheight ) { if ( ( thing -> friction == ORIG_FRICTION ) || ( f -> friction < thing -> friction ) ) { thing -> friction = f -> friction ; thing -> movefactor = f -> movefactor ; } } node = node -> m_snext ; } }
This is where abnormal friction is applied to objects in the sectors.
This is where abnormal friction is applied to objects in the sectors .
// Be sure the special sector type is still turned on. If so, proceed. // Else, bail out; the sector type has been changed on us. // Assign the friction value to players on the floor, non-floating, // and clipped. Normally the object's friction value is kept at // ORIG_FRICTION and this thinker changes it for icy or muddy floors. // In Phase II, you can apply friction to Things other than players. // When the object is straddling sectors with the same // floorheight that have different frictions, use the lowest // friction value (muddy has precedence over icy). // things touching this sector // normal friction?