diff --git a/src/deh_tables.c b/src/deh_tables.c index a9a7eafce..fd5841367 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5695,8 +5695,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_PAPERITEMSPOT", "MT_BEAMPOINT", - - "MT_NAMECHECK", }; const char *const MOBJFLAG_LIST[] = { diff --git a/src/g_game.c b/src/g_game.c index a3e505469..de53d8c6a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -477,8 +477,6 @@ consvar_t cv_digitaldeadzone[MAXSPLITSCREENPLAYERS] = { CVAR_INIT ("joy4_digdeadzone", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL) }; -player_t *seenplayer; // player we're aiming at right now - // now automatically allocated in D_RegisterClientCommands // so that it doesn't have to be updated depending on the value of MAXPLAYERS char player_names[MAXPLAYERS][MAXPLAYERNAME+1]; diff --git a/src/g_game.h b/src/g_game.h index 7d5f8359f..3bb5b73f4 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -25,7 +25,6 @@ extern char timeattackfolder[64]; extern char customversionstring[32]; #define GAMEDATASIZE (4*8192) -extern player_t *seenplayer; extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1]; extern INT32 player_name_changes[MAXPLAYERS]; diff --git a/src/info.h b/src/info.h index e41b394e5..85b496bb1 100644 --- a/src/info.h +++ b/src/info.h @@ -6710,8 +6710,6 @@ typedef enum mobj_type MT_BEAMPOINT, - MT_NAMECHECK, - MT_FIRSTFREESLOT, MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1, NUMMOBJTYPES diff --git a/src/lua_hook.h b/src/lua_hook.h index 6a66d70f2..022f6ad56 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -55,7 +55,6 @@ enum hook { hook_MusicChange, hook_TeamSwitch, hook_ViewpointSwitch, - hook_SeenPlayer, hook_PlayerThink, hook_ShouldJingleContinue, hook_GameQuit, @@ -123,7 +122,6 @@ boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj); // Hook for P_PlayerAft UINT8 LUAh_PlayerCanDamage(player_t *player, mobj_t *mobj); // Hook for P_PlayerCanDamage boolean LUAh_TeamSwitch(player_t *player, int newteam, boolean fromspectators, boolean tryingautobalance, boolean tryingscramble); // Hook for team switching in... uh.... UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean forced); // Hook for spy mode -boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend); // Hook for MT_NAMECHECK #define LUAh_PlayerThink(player) LUAh_PlayerHook(player, hook_PlayerThink) // Hook for P_PlayerThink boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname); // Hook for whether a jingle of the given music should continue playing void LUAh_GameQuit(boolean quitting); // Hook for game quitting diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index e06071911..8c7f22786 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -71,7 +71,6 @@ const char *const hookNames[hook_MAX+1] = { "MusicChange", "TeamSwitch", "ViewpointSwitch", - "SeenPlayer", "PlayerThink", "ShouldJingleContinue", "GameQuit", @@ -221,7 +220,6 @@ static int lib_addHook(lua_State *L) case hook_PlayerCanDamage: case hook_TeamSwitch: case hook_ViewpointSwitch: - case hook_SeenPlayer: case hook_ShieldSpawn: case hook_ShieldSpecial: case hook_PlayerThink: @@ -1773,51 +1771,6 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean return canSwitchView; } -// Hook for MT_NAMECHECK -boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend) -{ - hook_p hookp; - boolean hasSeenPlayer = true; - if (!gL || !(hooksAvailable[hook_SeenPlayer/8] & (1<<(hook_SeenPlayer%8)))) - return true; - - lua_settop(gL, 0); - lua_pushcfunction(gL, LUA_GetErrorMessage); - - hud_running = true; // local hook - - for (hookp = playerhooks; hookp; hookp = hookp->next) - { - if (hookp->type != hook_SeenPlayer) - continue; - - if (lua_gettop(gL) == 1) - { - LUA_PushUserdata(gL, player, META_PLAYER); - LUA_PushUserdata(gL, seenfriend, META_PLAYER); - } - PushHook(gL, hookp); - lua_pushvalue(gL, -3); - lua_pushvalue(gL, -3); - if (lua_pcall(gL, 2, 1, 1)) { - if (!hookp->error || cv_debug & DBG_LUA) - CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); - lua_pop(gL, 1); - hookp->error = true; - continue; - } - if (!lua_isnil(gL, -1) && !lua_toboolean(gL, -1)) - hasSeenPlayer = false; // Hasn't seen player - lua_pop(gL, 1); - } - - lua_settop(gL, 0); - - hud_running = false; - - return hasSeenPlayer; -} - boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname) { hook_p hookp; diff --git a/src/p_floor.c b/src/p_floor.c index 66c9ae601..a427eabb0 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1064,7 +1064,6 @@ static mobj_t *SearchMarioNode(msecnode_t *node) case MT_HOOP: case MT_HOOPCOLLIDE: case MT_NIGHTSCORE: - case MT_NAMECHECK: // DEFINITELY not this, because it is client-side. continue; default: break; diff --git a/src/p_map.c b/src/p_map.c index 7d42f04aa..ab4f13b82 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -487,32 +487,6 @@ static boolean PIT_CheckThing(mobj_t *thing) || (thing->player && thing->player->spectator)) return true; - // 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. - if (!thing->player || !(tmthing->target && tmthing->target->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 - - // REX HAS SEEN YOU - if (!LUAh_SeenPlayer(tmthing->target->player, thing->player)) - return false; - - seenplayer = thing->player; - return false; - } - if ((thing->flags & MF_NOCLIPTHING) || !(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE|MF_SPRING))) return true;