From 0852a20014adb914ba7e56d6872a7eebc830664e Mon Sep 17 00:00:00 2001
From: toasterbabe <rollerorbital@gmail.com>
Date: Fri, 2 Sep 2016 18:12:46 +0100
Subject: [PATCH] Revitem is saved by tying it to leveltime instead of
 dashtime, whilst dashtime is now dead.

---
 src/d_clisrv.c      |  2 --
 src/d_clisrv.h      |  1 -
 src/d_player.h      |  1 -
 src/lua_playerlib.c |  4 ----
 src/p_saveg.c       |  2 --
 src/p_user.c        | 20 ++++++--------------
 6 files changed, 6 insertions(+), 24 deletions(-)

diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index e49f37e2a3..f4caf66e63 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -550,7 +550,6 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i)
 
 	rsp->maxlink = LONG(players[i].maxlink);
 	rsp->dashspeed = (fixed_t)LONG(players[i].dashspeed);
-	rsp->dashtime = LONG(players[i].dashtime);
 	rsp->angle_pos = (angle_t)LONG(players[i].angle_pos);
 	rsp->old_angle_pos = (angle_t)LONG(players[i].old_angle_pos);
 	rsp->bumpertime = (tic_t)LONG(players[i].bumpertime);
@@ -677,7 +676,6 @@ static void resynch_read_player(resynch_pak *rsp)
 
 	players[i].maxlink = LONG(rsp->maxlink);
 	players[i].dashspeed = (fixed_t)LONG(rsp->dashspeed);
-	players[i].dashtime = LONG(rsp->dashtime);
 	players[i].angle_pos = (angle_t)LONG(rsp->angle_pos);
 	players[i].old_angle_pos = (angle_t)LONG(rsp->old_angle_pos);
 	players[i].bumpertime = (tic_t)LONG(rsp->bumpertime);
diff --git a/src/d_clisrv.h b/src/d_clisrv.h
index f9e33dc4c2..9d130618ba 100644
--- a/src/d_clisrv.h
+++ b/src/d_clisrv.h
@@ -210,7 +210,6 @@ typedef struct
 
 	INT32 maxlink;
 	fixed_t dashspeed;
-	INT32 dashtime;
 	angle_t angle_pos;
 	angle_t old_angle_pos;
 	tic_t bumpertime;
diff --git a/src/d_player.h b/src/d_player.h
index f57eb90cff..59875b4cc8 100644
--- a/src/d_player.h
+++ b/src/d_player.h
@@ -319,7 +319,6 @@ typedef struct player_s
 
 	UINT32 score; // player score
 	fixed_t dashspeed; // dashing speed
-	INT32 dashtime; // tics dashing, used for rev sound
 
 	fixed_t normalspeed; // Normal ground
 	fixed_t runspeed; // Speed you break into the run animation
diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c
index 60119deae0..c83aa8811e 100644
--- a/src/lua_playerlib.c
+++ b/src/lua_playerlib.c
@@ -142,8 +142,6 @@ static int player_get(lua_State *L)
 		lua_pushinteger(L, plr->score);
 	else if (fastcmp(field,"dashspeed"))
 		lua_pushfixed(L, plr->dashspeed);
-	else if (fastcmp(field,"dashtime"))
-		lua_pushinteger(L, plr->dashtime);
 	else if (fastcmp(field,"normalspeed"))
 		lua_pushfixed(L, plr->normalspeed);
 	else if (fastcmp(field,"runspeed"))
@@ -401,8 +399,6 @@ static int player_set(lua_State *L)
 		plr->score = (UINT32)luaL_checkinteger(L, 3);
 	else if (fastcmp(field,"dashspeed"))
 		plr->dashspeed = luaL_checkfixed(L, 3);
-	else if (fastcmp(field,"dashtime"))
-		plr->dashtime = (INT32)luaL_checkinteger(L, 3);
 	else if (fastcmp(field,"normalspeed"))
 		plr->normalspeed = luaL_checkfixed(L, 3);
 	else if (fastcmp(field,"runspeed"))
diff --git a/src/p_saveg.c b/src/p_saveg.c
index 964e8b7742..768949b3c9 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -147,7 +147,6 @@ static void P_NetArchivePlayers(void)
 
 		WRITEUINT32(save_p, players[i].score);
 		WRITEFIXED(save_p, players[i].dashspeed);
-		WRITEINT32(save_p, players[i].dashtime);
 		WRITESINT8(save_p, players[i].lives);
 		WRITESINT8(save_p, players[i].continues);
 		WRITESINT8(save_p, players[i].xtralife);
@@ -323,7 +322,6 @@ static void P_NetUnArchivePlayers(void)
 
 		players[i].score = READUINT32(save_p);
 		players[i].dashspeed = READFIXED(save_p); // dashing speed
-		players[i].dashtime = READINT32(save_p); // dashing speed
 		players[i].lives = READSINT8(save_p);
 		players[i].continues = READSINT8(save_p); // continues that player has acquired
 		players[i].xtralife = READSINT8(save_p); // Ring Extra Life counter
diff --git a/src/p_user.c b/src/p_user.c
index 73f68e60e0..b165560f43 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -3728,7 +3728,6 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
 			player->mo->momy = player->cmomy;
 			player->pflags |= PF_STARTDASH|PF_SPINNING;
 			player->dashspeed = FRACUNIT;
-			player->dashtime = 0;
 			P_SetPlayerMobjState(player->mo, S_PLAY_DASH);
 			player->pflags |= PF_USEDOWN;
 			if (!player->spectator)
@@ -3742,21 +3741,14 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
 			if (!player->spectator && soundcalculation != chargecalculation)
 				S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh.
 #undef chargecalculation
-
-			/*if (!(player->dashtime++ % 5))
+			if (player->revitem && !(leveltime % 5)) // Now spawn the color thok circle.
 			{
-				if (!player->spectator && player->dashspeed < player->maxdash)
-					S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh.
-
-				// Now spawn the color thok circle.
-				if (player->revitem)
-				{
-					P_SpawnSpinMobj(player, player->revitem);
-					if (demorecording)
-						G_GhostAddRev();
-				}
-			}*/
+				P_SpawnSpinMobj(player, player->revitem);
+				if (demorecording)
+					G_GhostAddRev();
+			}
 		}
+
 		// If not moving up or down, and travelling faster than a speed of four while not holding
 		// down the spin button and not spinning.
 		// AKA Just go into a spin on the ground, you idiot. ;)
-- 
GitLab