Skip to content

Commit

Permalink
Hexen|Fixed: Fog cloud movement
Browse files Browse the repository at this point in the history
The movement of fog clouds is now smooth on the Z axis. The original
implementation just added an offset to the Z coordinate at 4 tic
intervals.
  • Loading branch information
skyjake committed Aug 27, 2012
1 parent fc9f887 commit 663477f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doomsday/plugins/jhexen/src/a_action.c
Expand Up @@ -506,7 +506,7 @@ void C_DECL A_FogSpawn(mobj_t* actor)
void C_DECL A_FogMove(mobj_t* actor)
{
coord_t speed = (coord_t) actor->args[0];
uint an, weaveindex;
uint an;

if(!(actor->args[4]))
return;
Expand All @@ -517,10 +517,14 @@ void C_DECL A_FogMove(mobj_t* actor)
return;
}

// Move the fog slightly/slowly up and down. Some fog patches are supposed
// to move higher and some are supposed to stay close to the ground.
// Unlike in the original Hexen, the move is done by applying momentum
// to the cloud so that the movement is smooth.
if((actor->args[3] % 4) == 0)
{
weaveindex = actor->special2;
actor->origin[VZ] += FLOATBOBOFFSET(weaveindex) * 2;
uint weaveindex = actor->special2;
actor->mom[VZ] = FLOATBOBOFFSET(weaveindex) / TICSPERSEC;
actor->special2 = (weaveindex + 1) & 63;
}

Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jhexen/src/p_mobj.c
Expand Up @@ -1505,6 +1505,9 @@ boolean P_HitFloor(mobj_t* thing)
case MT_LEAF2:
case MT_SPLASH:
case MT_SLUDGECHUNK:
case MT_FOGPATCHS:
case MT_FOGPATCHM:
case MT_FOGPATCHL:
return false;

default:
Expand Down

0 comments on commit 663477f

Please sign in to comment.