mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Actually just get rid of seenplayer and NAMECHECK altogether.
This commit is contained in:
parent
48d46c19e0
commit
8344ac3489
8 changed files with 0 additions and 83 deletions
|
|
@ -5695,8 +5695,6 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
||||||
"MT_PAPERITEMSPOT",
|
"MT_PAPERITEMSPOT",
|
||||||
|
|
||||||
"MT_BEAMPOINT",
|
"MT_BEAMPOINT",
|
||||||
|
|
||||||
"MT_NAMECHECK",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *const MOBJFLAG_LIST[] = {
|
const char *const MOBJFLAG_LIST[] = {
|
||||||
|
|
|
||||||
|
|
@ -477,8 +477,6 @@ consvar_t cv_digitaldeadzone[MAXSPLITSCREENPLAYERS] = {
|
||||||
CVAR_INIT ("joy4_digdeadzone", "0.25", CV_FLOAT|CV_SAVE, zerotoone_cons_t, NULL)
|
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
|
// now automatically allocated in D_RegisterClientCommands
|
||||||
// so that it doesn't have to be updated depending on the value of MAXPLAYERS
|
// so that it doesn't have to be updated depending on the value of MAXPLAYERS
|
||||||
char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
|
char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ extern char timeattackfolder[64];
|
||||||
extern char customversionstring[32];
|
extern char customversionstring[32];
|
||||||
#define GAMEDATASIZE (4*8192)
|
#define GAMEDATASIZE (4*8192)
|
||||||
|
|
||||||
extern player_t *seenplayer;
|
|
||||||
extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
|
extern char player_names[MAXPLAYERS][MAXPLAYERNAME+1];
|
||||||
extern INT32 player_name_changes[MAXPLAYERS];
|
extern INT32 player_name_changes[MAXPLAYERS];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6710,8 +6710,6 @@ typedef enum mobj_type
|
||||||
|
|
||||||
MT_BEAMPOINT,
|
MT_BEAMPOINT,
|
||||||
|
|
||||||
MT_NAMECHECK,
|
|
||||||
|
|
||||||
MT_FIRSTFREESLOT,
|
MT_FIRSTFREESLOT,
|
||||||
MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1,
|
MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1,
|
||||||
NUMMOBJTYPES
|
NUMMOBJTYPES
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ enum hook {
|
||||||
hook_MusicChange,
|
hook_MusicChange,
|
||||||
hook_TeamSwitch,
|
hook_TeamSwitch,
|
||||||
hook_ViewpointSwitch,
|
hook_ViewpointSwitch,
|
||||||
hook_SeenPlayer,
|
|
||||||
hook_PlayerThink,
|
hook_PlayerThink,
|
||||||
hook_ShouldJingleContinue,
|
hook_ShouldJingleContinue,
|
||||||
hook_GameQuit,
|
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
|
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....
|
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
|
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
|
#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
|
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
|
void LUAh_GameQuit(boolean quitting); // Hook for game quitting
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ const char *const hookNames[hook_MAX+1] = {
|
||||||
"MusicChange",
|
"MusicChange",
|
||||||
"TeamSwitch",
|
"TeamSwitch",
|
||||||
"ViewpointSwitch",
|
"ViewpointSwitch",
|
||||||
"SeenPlayer",
|
|
||||||
"PlayerThink",
|
"PlayerThink",
|
||||||
"ShouldJingleContinue",
|
"ShouldJingleContinue",
|
||||||
"GameQuit",
|
"GameQuit",
|
||||||
|
|
@ -221,7 +220,6 @@ static int lib_addHook(lua_State *L)
|
||||||
case hook_PlayerCanDamage:
|
case hook_PlayerCanDamage:
|
||||||
case hook_TeamSwitch:
|
case hook_TeamSwitch:
|
||||||
case hook_ViewpointSwitch:
|
case hook_ViewpointSwitch:
|
||||||
case hook_SeenPlayer:
|
|
||||||
case hook_ShieldSpawn:
|
case hook_ShieldSpawn:
|
||||||
case hook_ShieldSpecial:
|
case hook_ShieldSpecial:
|
||||||
case hook_PlayerThink:
|
case hook_PlayerThink:
|
||||||
|
|
@ -1773,51 +1771,6 @@ UINT8 LUAh_ViewpointSwitch(player_t *player, player_t *newdisplayplayer, boolean
|
||||||
return canSwitchView;
|
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)
|
boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
|
|
|
||||||
|
|
@ -1064,7 +1064,6 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
|
||||||
case MT_HOOP:
|
case MT_HOOP:
|
||||||
case MT_HOOPCOLLIDE:
|
case MT_HOOPCOLLIDE:
|
||||||
case MT_NIGHTSCORE:
|
case MT_NIGHTSCORE:
|
||||||
case MT_NAMECHECK: // DEFINITELY not this, because it is client-side.
|
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
26
src/p_map.c
26
src/p_map.c
|
|
@ -487,32 +487,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
|| (thing->player && thing->player->spectator))
|
|| (thing->player && thing->player->spectator))
|
||||||
return true;
|
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)))
|
if ((thing->flags & MF_NOCLIPTHING) || !(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE|MF_SPRING)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue