diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg
index c592b09d9754a26aa14ee108d835cf10fdde5d1a..dcff6927b50d50b13a9d7d9e1749b46dc559a8c6 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 57e12d34c37e7721898522d116f334861f552560..1af4803d6c4c1a6ab411dde9ac6e6b6c68ba0520 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 e41e30d05d4482ece4516d5cdfedfc1fbf1bfe30..1a1cb89903b4fa70e3afaea4abd89aa0b7355477 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 aa732bc632ced45afa71b85c9de73540d7a6b218..c1ceadad3638503f335dbf8e7addbd270d6223a6 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);