diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index c592b09d9..dcff6927b 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -1744,6 +1744,31 @@ udmf } } + 257 + { + title = "Quicksand"; + prefix = "(257)"; + arg0 + { + title = "Target sector tag"; + type = 13; + } + arg1 + { + title = "Ripple effect?"; + type = 11; + enum = "yesno"; + } + arg2 + { + title = "Sinking speed"; + } + arg3 + { + title = "Friction"; + } + } + 258 { title = "Laser"; diff --git a/src/p_setup.c b/src/p_setup.c index 57e12d34c..1af4803d6 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3022,6 +3022,13 @@ static void P_ConvertBinaryMap(void) lines[i].special = 254; break; + case 257: //FOF: Quicksand + lines[i].args[0] = lines[i].tag; + if (!(lines[i].flags & ML_EFFECT5)) + lines[i].args[1] = 1; //No ripple effect + lines[i].args[2] = lines[i].dx >> FRACBITS; //Sinking speed + lines[i].args[3] = lines[i].dy >> FRACBITS; //Friction + break; case 258: //FOF: Laser lines[i].args[0] = lines[i].tag; if (lines[i].flags & ML_EFFECT1) diff --git a/src/p_spec.c b/src/p_spec.c index e41e30d05..1a1cb8990 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7041,7 +7041,7 @@ void P_SpawnSpecials(boolean fromnetsave) case 257: // Quicksand ffloorflags = FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES; - if (lines[i].flags & ML_EFFECT5) + if (!(lines[i].args[1])) ffloorflags |= FF_RIPPLE; P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); diff --git a/src/p_user.c b/src/p_user.c index aa732bc63..c1ceadad3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2844,7 +2844,7 @@ static void P_CheckQuicksand(player_t *player) if (topheight >= player->mo->z && bottomheight < player->mo->z + player->mo->height) { - sinkspeed = abs(rover->master->v1->x - rover->master->v2->x)>>1; + sinkspeed = abs(rover->master->args[2]) << (FRACBITS - 1); sinkspeed = FixedDiv(sinkspeed,TICRATE*FRACUNIT); @@ -2873,7 +2873,7 @@ static void P_CheckQuicksand(player_t *player) P_PlayerHitFloor(player, false); } - friction = abs(rover->master->v1->y - rover->master->v2->y)>>6; + friction = abs(rover->master->args[3]) << (FRACBITS - 6); player->mo->momx = FixedMul(player->mo->momx, friction); player->mo->momy = FixedMul(player->mo->momy, friction);