From 23ff7f15a8da6d1cf599e1169ff025bce3978fbc Mon Sep 17 00:00:00 2001
From: Yukita Mayako <catgirl@goddess.moe>
Date: Thu, 10 Mar 2016 19:14:06 -0500
Subject: [PATCH] Removed SEENAMES

---
 src/d_netcmd.c | 13 -------------
 src/d_netcmd.h |  3 ---
 src/dehacked.c |  7 -------
 src/doomdef.h  |  3 ---
 src/g_game.c   |  4 ----
 src/g_game.h   |  3 ---
 src/info.c     |  3 ---
 src/m_menu.c   |  3 ---
 src/p_floor.c  |  3 ---
 src/p_local.h  |  3 ---
 src/p_map.c    | 25 -------------------------
 src/p_user.c   | 27 ---------------------------
 src/st_stuff.c | 15 ---------------
 13 files changed, 112 deletions(-)

diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index 2efd7947f6..d0f83ec3ac 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -215,12 +215,6 @@ consvar_t cv_respawntime = {"respawndelay", "3", CV_NETVAR|CV_CHEAT, respawntime
 
 consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 
-#ifdef SEENAMES
-static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
-consvar_t cv_seenames = {"seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
-consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
-#endif
-
 // these are just meant to be saved to the config
 consvar_t cv_playername = {"name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
 consvar_t cv_playername2 = {"name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
@@ -516,10 +510,6 @@ void D_RegisterServerCommands(void)
 	CV_RegisterVar(&cv_skipmapcheck);
 	CV_RegisterVar(&cv_sleep);
 
-#ifdef SEENAMES
-	 CV_RegisterVar(&cv_allowseenames);
-#endif
-
 	CV_RegisterVar(&cv_dummyconsvar);
 }
 
@@ -599,9 +589,6 @@ void D_RegisterClientCommands(void)
 	CV_RegisterVar(&cv_playercolor2);
 	CV_RegisterVar(&cv_skin2);
 
-#ifdef SEENAMES
-	CV_RegisterVar(&cv_seenames);
-#endif
 	CV_RegisterVar(&cv_rollingdemos);
 	CV_RegisterVar(&cv_netstat);
 
diff --git a/src/d_netcmd.h b/src/d_netcmd.h
index 4c0e2909ae..f09d3043db 100644
--- a/src/d_netcmd.h
+++ b/src/d_netcmd.h
@@ -20,9 +20,6 @@
 // console vars
 extern consvar_t cv_playername;
 extern consvar_t cv_playercolor;
-#ifdef SEENAMES
-extern consvar_t cv_seenames, cv_allowseenames;
-#endif
 extern consvar_t cv_usemouse;
 extern consvar_t cv_usejoystick;
 extern consvar_t cv_usejoystick2;
diff --git a/src/dehacked.c b/src/dehacked.c
index 313c9b8dc5..f547e6b590 100644
--- a/src/dehacked.c
+++ b/src/dehacked.c
@@ -6630,10 +6630,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
 
 	"S_SRB1_GENREX1",
 	"S_SRB1_GENREX2",
-
-#ifdef SEENAMES
-	"S_NAMECHECK",
-#endif
 };
 
 // RegEx to generate this from info.h: ^\tMT_([^,]+), --> \t"MT_\1",
@@ -7142,9 +7138,6 @@ static const char *const MOBJTYPE_LIST[] = {  // array length left dynamic for s
 	"MT_SRB1_METALSONIC",
 	"MT_SRB1_GOLDBOT",
 	"MT_SRB1_GENREX",
-#ifdef SEENAMES
-	"MT_NAMECHECK",
-#endif
 };
 
 static const char *const MOBJFLAG_LIST[] = {
diff --git a/src/doomdef.h b/src/doomdef.h
index dc47721ef4..6697093c65 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -465,9 +465,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
 ///	\todo	Remove this define.
 #define BLUE_SPHERES // Blue spheres for future use.
 
-///	See name of player in your crosshair
-#define SEENAMES
-
 ///	Who put weights on my recycler?  ... Inuyasha did.
 ///	\note	XMOD port.
 //#define WEIGHTEDRECYCLER
diff --git a/src/g_game.c b/src/g_game.c
index 737f931603..09b315ceb9 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -438,10 +438,6 @@ consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL
 consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
 #endif
 
-#ifdef SEENAMES
-player_t *seenplayer; // player we're aiming at right now
-#endif
-
 char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
 
 INT16 rw_maximums[NUM_WEAPONS] =
diff --git a/src/g_game.h b/src/g_game.h
index 0d1720d186..4c232304cc 100644
--- a/src/g_game.h
+++ b/src/g_game.h
@@ -23,9 +23,6 @@ extern char timeattackfolder[64];
 extern char customversionstring[32];
 #define GAMEDATASIZE (4*8192)
 
-#ifdef SEENAMES
-extern player_t *seenplayer;
-#endif
 extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
 
 extern player_t players[MAXPLAYERS];
diff --git a/src/info.c b/src/info.c
index 6e98de0a37..9c81ecf295 100644
--- a/src/info.c
+++ b/src/info.c
@@ -3059,9 +3059,6 @@ state_t states[NUMSTATES] =
 
 	{SPR_SRBO, 0, 2, {A_Look}, 0, 0, S_SRB1_GENREX1}, // S_SRB1_GENREX1
 	{SPR_SRBO, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_GENREX2}, // S_SRB1_GENREX2
-#ifdef SEENAMES
-	{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
-#endif
 };
 
 mobjinfo_t mobjinfo[NUMMOBJTYPES] =
diff --git a/src/m_menu.c b/src/m_menu.c
index 9c14be9215..228ccedf46 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -1276,9 +1276,6 @@ static menuitem_t OP_GameOptionsMenu[] =
 	{IT_STRING | IT_CVAR | IT_CV_SLIDER,
 	                      NULL, "HUD Visibility",         &cv_translucenthud, 50},
 	{IT_STRING | IT_CVAR, NULL, "Timer Display",          &cv_timetic,     60},
-#ifdef SEENAMES
-	{IT_STRING | IT_CVAR, NULL, "HUD Player Names",       &cv_seenames,    80},
-#endif
 	{IT_STRING | IT_CVAR, NULL, "Log Hazard Damage",      &cv_hazardlog,   90},
 
 	{IT_STRING | IT_CVAR, NULL, "Console Back Color",     &cons_backcolor, 100},
diff --git a/src/p_floor.c b/src/p_floor.c
index ec52abeb96..ffa458d453 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -1774,9 +1774,6 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
 		case MT_HOOP:
 		case MT_HOOPCOLLIDE:
 		case MT_NIGHTSCORE:
-#ifdef SEENAMES
-		case MT_NAMECHECK: // DEFINITELY not this, because it is client-side.
-#endif
 			continue;
 		default:
 			break;
diff --git a/src/p_local.h b/src/p_local.h
index 6bd4029128..d10cd24894 100644
--- a/src/p_local.h
+++ b/src/p_local.h
@@ -244,9 +244,6 @@ mobj_t *P_SpawnPointMissile(mobj_t *source, fixed_t xa, fixed_t ya, fixed_t za,
 mobj_t *P_SpawnAlteredDirectionMissile(mobj_t *source, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z, INT32 shiftingAngle);
 mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 aimtype, UINT32 flags2);
 #define P_SpawnPlayerMissile(s,t,f) P_SPMAngle(s,t,s->angle,true,f)
-#ifdef SEENAMES
-#define P_SpawnNameFinder(s,t) P_SPMAngle(s,t,s->angle,true,0)
-#endif
 void P_ColorTeamMissile(mobj_t *missile, player_t *source);
 SINT8 P_MobjFlip(mobj_t *mobj);
 boolean P_WeaponOrPanel(mobjtype_t type);
diff --git a/src/p_map.c b/src/p_map.c
index ca66946ba1..ff2474d167 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -310,31 +310,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
 	|| (thing->player && thing->player->spectator))
 		return true;
 
-#ifdef SEENAMES
-  // Do name checks all the way up here
-  // So that NOTHING ELSE can see MT_NAMECHECK because it is client-side.
-	if (tmthing->type == MT_NAMECHECK)
-	{
-	  // Ignore things that aren't players, ignore spectators, ignore yourself.
-		// (also don't bother to check that tmthing->target->player is non-NULL because we're not actually using it here.)
-		if (!thing->player || thing->player->spectator || (tmthing->target && thing->player == tmthing->target->player))
-			return true;
-
-		// Now check that you actually hit them.
-		blockdist = thing->radius + tmthing->radius;
-		if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist)
-			return true; // didn't hit it
-		// see if it went over / under
-		if (tmthing->z > thing->z + thing->height)
-			return true; // overhead
-		if (tmthing->z + tmthing->height < thing->z)
-			return true; // underneath
-
-		seenplayer = thing->player;
-		return false;
-	}
-#endif
-
 	// Metal Sonic destroys tiny baby objects.
 	if (tmthing->type == MT_METALSONIC_RACE
 	&& (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE))
diff --git a/src/p_user.c b/src/p_user.c
index 975d7a2f91..ae41aae9e0 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -4881,7 +4881,6 @@ static void P_SpectatorMovement(player_t *player)
 	else if (cmd->buttons & BT_USE)
 		player->mo->z -= FRACUNIT*16;
 
-	// Aiming needed for SEENAMES, etc.
 	// We may not need to fire as a spectator, but this is still handy!
 	player->aiming = cmd->aiming<<FRACBITS;
 
@@ -8656,32 +8655,6 @@ void P_PlayerThink(player_t *player)
 			return;
 	}
 
-#ifdef SEENAMES
-	if (netgame && player == &players[displayplayer] && !(leveltime % (TICRATE/5)))
-	{
-		seenplayer = NULL;
-
-		if (cv_seenames.value && cv_allowseenames.value &&
-			!(G_TagGametype() && (player->pflags & PF_TAGIT)))
-		{
-			mobj_t *mo = P_SpawnNameFinder(player->mo, MT_NAMECHECK);
-
-			if (mo)
-			{
-				short int i;
-				mo->flags |= MF_NOCLIPHEIGHT;
-				for (i = 0; i < 32; i++)
-				{
-					// Debug drawing
-//					if (i&1)
-//						P_SpawnMobj(mo->x, mo->y, mo->z, MT_SPARK);
-					if (P_RailThinker(mo))
-						break; // mobj was removed (missile hit a wall) or couldn't move
-				}
-			}
-		}
-	}
-#endif
 	if (player->pflags & PF_GLIDING)
 	{
 		if (player->panim != PA_ABILITY)
diff --git a/src/st_stuff.c b/src/st_stuff.c
index ba5ae1ec08..84f611f7f4 100644
--- a/src/st_stuff.c
+++ b/src/st_stuff.c
@@ -1891,21 +1891,6 @@ static void ST_overlayDrawer(void)
 
 void ST_Drawer(boolean refresh)
 {
-#ifdef SEENAMES
-	if (cv_seenames.value && cv_allowseenames.value && displayplayer == consoleplayer && seenplayer && seenplayer->mo)
-	{
-		if (cv_seenames.value == 1)
-			V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]);
-		else if (cv_seenames.value == 2)
-			V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF,
-			va("%s%s", G_GametypeHasTeams() ? ((seenplayer->ctfteam == 1) ? "\x85" : "\x84") : "", player_names[seenplayer-players]));
-		else //if (cv_seenames.value == 3)
-			V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF,
-			va("%s%s", !G_RingSlingerGametype() || (G_GametypeHasTeams() && players[consoleplayer].ctfteam == seenplayer->ctfteam)
-			 ? "\x83" : "\x85", player_names[seenplayer-players]));
-	}
-#endif
-
 	// force a set of the palette by using doPaletteStuff()
 	(void)refresh; //?
 	if (vid.recalc)
-- 
GitLab