From 60eaae7b2b29134d7e3386273716fa42de785f64 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Wed, 11 May 2022 12:51:53 -0700 Subject: [PATCH] Adjust naming against upstream. --- src/client/entities.qc | 2 +- src/client/player.qc | 6 ++-- src/client/view.qc | 2 +- src/server/damage.qc | 2 +- src/server/gamerules.h | 48 ++++++++++++++-------------- src/server/gamerules.qc | 18 +++++------ src/server/gamerules_multiplayer.qc | 37 +++++++++------------ src/server/gamerules_singleplayer.qc | 4 +-- src/shared/player.h | 2 +- src/shared/player.qc | 10 +++--- src/shared/pmove.qc | 28 ++++++++-------- src/shared/pmove_water.qc | 2 +- src/shared/weapons.qc | 2 +- 13 files changed, 78 insertions(+), 85 deletions(-) diff --git a/src/client/entities.qc b/src/client/entities.qc index 340872c..30e1f5c 100644 --- a/src/client/entities.qc +++ b/src/client/entities.qc @@ -33,5 +33,5 @@ void ClientGame_EntityRemove(void) { if (self.classname == "player") - Player_DestroyWeaponModel((base_player) self); + Player_DestroyWeaponModel((NSClientPlayer) self); } diff --git a/src/client/player.qc b/src/client/player.qc index f90ffc5..59d1637 100644 --- a/src/client/player.qc +++ b/src/client/player.qc @@ -90,7 +90,7 @@ string g_pbones[] = }; void -Player_HandleWeaponModel(base_player pp, float thirdperson) +Player_HandleWeaponModel(NSClientPlayer pp, float thirdperson) { player pl = (player)pp; @@ -164,11 +164,11 @@ Player_DestroyWeaponModel(entity pp) } -//TAGGG - NOTE! In case it ever matters, parameter "base_player pl" renamed to "base_player pp". +//TAGGG - NOTE! In case it ever matters, parameter "NSClientPlayer pl" renamed to "NSClientPlayer pp". // Doubt it ever should, no idea if FTE would complain about a discrepency between prototype and // implementation parameter names if that ever happened. void -Player_PreDraw(base_player pp, int thirdperson) +Player_PreDraw(NSClientPlayer pp, int thirdperson) { player pl = (player)pp; diff --git a/src/client/view.qc b/src/client/view.qc index b545149..6f26a08 100644 --- a/src/client/view.qc +++ b/src/client/view.qc @@ -485,7 +485,7 @@ TS_View_DrawExtraEffects(player pl, int thirdperson) //int thirdperson = (autocvar_cl_thirdperson == TRUE || this.entnum != player_localentnum); - //base_player pp = (base_player)this; + //NSClientPlayer pp = (NSClientPlayer)this; BOOL canRenderFlashlight = FALSE; BOOL canRenderLaserSight = FALSE; diff --git a/src/server/damage.qc b/src/server/damage.qc index 9276081..9208d04 100644 --- a/src/server/damage.qc +++ b/src/server/damage.qc @@ -24,7 +24,7 @@ void Damage_Apply(entity t, entity c, float dmg, int w, damageType_t type) { - base_player tp = (base_player)t; + NSClientPlayer tp = (NSClientPlayer)t; CGameRules rules = (CGameRules)g_grMode; diff --git a/src/server/gamerules.h b/src/server/gamerules.h index a454cf3..6f6198b 100644 --- a/src/server/gamerules.h +++ b/src/server/gamerules.h @@ -58,24 +58,24 @@ class player; class TSGameRules:CGameRules { - virtual void(base_player) PlayerConnect; - virtual void(base_player) PlayerDisconnect; - virtual void(base_player) PlayerKill; - virtual void(base_player) PlayerPreFrame; - virtual void(base_player) PlayerPostFrame; - virtual void(base_player) PlayerDeath; - virtual void(base_player) PlayerPain; + virtual void(NSClientPlayer) PlayerConnect; + virtual void(NSClientPlayer) PlayerDisconnect; + virtual void(NSClientPlayer) PlayerKill; + virtual void(NSClientPlayer) PlayerPreFrame; + virtual void(NSClientPlayer) PlayerPostFrame; + virtual void(NSClientPlayer) PlayerDeath; + virtual void(NSClientPlayer) PlayerPain; - virtual void(base_player) LevelDecodeParms; - virtual void(base_player) LevelChangeParms; + virtual void(NSClientPlayer) LevelDecodeParms; + virtual void(NSClientPlayer) LevelChangeParms; virtual void(void) LevelNewParms; }; class TSSingleplayerRules:TSGameRules { /* client */ - virtual void(base_player) PlayerSpawn; - virtual void(base_player) PlayerDeath; + virtual void(NSClientPlayer) PlayerSpawn; + virtual void(NSClientPlayer) PlayerDeath; }; class TSMultiplayerRules:TSGameRules @@ -92,12 +92,12 @@ class TSMultiplayerRules:TSGameRules virtual void(void) FrameStart; /* client */ - virtual void(base_player) PlayerDisconnect; - virtual void(base_player) PlayerSpawn; - virtual void(base_player) PlayerPreFrame; - virtual void(base_player) PlayerPostFrame; - virtual void(base_player) PlayerDeath; - virtual float(base_player, string) ConsoleCommand; + virtual void(NSClientPlayer) PlayerDisconnect; + virtual void(NSClientPlayer) PlayerSpawn; + virtual void(NSClientPlayer) PlayerPreFrame; + virtual void(NSClientPlayer) PlayerPostFrame; + virtual void(NSClientPlayer) PlayerDeath; + virtual float(NSClientPlayer, string) ConsoleCommand; virtual void(float, int) TimerBegin; virtual void(void) TimerUpdate; @@ -105,19 +105,19 @@ class TSMultiplayerRules:TSGameRules virtual void(int, int, int) RoundOver; virtual void(int) RestartRound; - virtual void(base_player) DeathCheck; + virtual void(NSClientPlayer) DeathCheck; virtual void(void) CountPlayers; //virtual void(void) SwitchTeams; virtual void(void) TimeOut; virtual void(player pl) MakePlayerInvisible; - virtual void(base_player) PlayerMakePlayable; - virtual void(base_player pp) PlayerMakePlayableWithDefaultMoney; - virtual void(base_player) PlayerMakeSpectator; - virtual void(base_player) PlayerMakeSpectatorAndNotify; - virtual void(base_player pp) PlayerMakeSpectatorDelayed; - virtual void(base_player, int) PlayerRespawn; + virtual void(NSClientPlayer) PlayerMakePlayable; + virtual void(NSClientPlayer pp) PlayerMakePlayableWithDefaultMoney; + virtual void(NSClientPlayer) PlayerMakeSpectator; + virtual void(NSClientPlayer) PlayerMakeSpectatorAndNotify; + virtual void(NSClientPlayer pp) PlayerMakeSpectatorDelayed; + virtual void(NSClientPlayer, int) PlayerRespawn; virtual entity(float) PlayerFindSpawn; virtual void(player pl) setPlayerMoneyDefault; diff --git a/src/server/gamerules.qc b/src/server/gamerules.qc index 4508f56..3bc999d 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -52,12 +52,12 @@ var float global_nextBreakableRespawn = 0; void -TSGameRules::PlayerDeath(base_player pp) +TSGameRules::PlayerDeath(NSClientPlayer pp) { } void -TSGameRules::PlayerPain(base_player pp) +TSGameRules::PlayerPain(NSClientPlayer pp) { // Why was this using "self" instead of the "pp"? haha.. the pp. // Also this is completely new to FreeCS and probably FreeHL. ? @@ -69,7 +69,7 @@ TSGameRules::PlayerPain(base_player pp) // CRITICAL. Do any new player vars need to be copied too, // same for LevelChangeParams further down? void -TSGameRules::LevelDecodeParms(base_player pp) +TSGameRules::LevelDecodeParms(NSClientPlayer pp) { player pl = (player)pp; g_landmarkpos[0] = parm1; @@ -120,7 +120,7 @@ TSGameRules::LevelDecodeParms(base_player pp) } void -TSGameRules::LevelChangeParms(base_player pp) +TSGameRules::LevelChangeParms(NSClientPlayer pp) { player pl = (player)pp; parm1 = g_landmarkpos[0]; @@ -183,7 +183,7 @@ TSGameRules::LevelNewParms(void) // NEW. Need PlayerPreFrame as well. void -TSGameRules::PlayerPreFrame(base_player pp) +TSGameRules::PlayerPreFrame(NSClientPlayer pp) { // Is this null check redundant? if(pp != NULL){ @@ -194,7 +194,7 @@ TSGameRules::PlayerPreFrame(base_player pp) } void -TSGameRules::PlayerPostFrame(base_player pp) +TSGameRules::PlayerPostFrame(NSClientPlayer pp) { //TAGGG - NEW // Is this null check redundant? @@ -206,14 +206,14 @@ TSGameRules::PlayerPostFrame(base_player pp) } void -TSGameRules::PlayerConnect(base_player pl) +TSGameRules::PlayerConnect(NSClientPlayer pl) { if (Plugin_PlayerConnect(pl) == FALSE) bprint(PRINT_HIGH, sprintf("%s connected\n", pl.netname)); } void -TSGameRules::PlayerDisconnect(base_player pl) +TSGameRules::PlayerDisconnect(NSClientPlayer pl) { if (Plugin_PlayerDisconnect(pl) == FALSE) bprint(PRINT_HIGH, sprintf("%s disconnected\n", pl.netname)); @@ -235,7 +235,7 @@ TSGameRules::PlayerDisconnect(base_player pl) } void -TSGameRules::PlayerKill(base_player pl) +TSGameRules::PlayerKill(NSClientPlayer pl) { //because we are TS. //Damage_Apply(pl, pl, pl.health, WEAPON_NONE, DMG_SKIP_ARMOR); diff --git a/src/server/gamerules_multiplayer.qc b/src/server/gamerules_multiplayer.qc index 8a9303d..2c229ba 100644 --- a/src/server/gamerules_multiplayer.qc +++ b/src/server/gamerules_multiplayer.qc @@ -149,7 +149,7 @@ TSMultiplayerRules::FrameStart(void) void -TSMultiplayerRules::PlayerPreFrame(base_player pp) +TSMultiplayerRules::PlayerPreFrame(NSClientPlayer pp) { TSGameRules::PlayerPreFrame(pp); @@ -171,7 +171,7 @@ TSMultiplayerRules::PlayerPreFrame(base_player pp) } void -TSMultiplayerRules::PlayerPostFrame(base_player pp) +TSMultiplayerRules::PlayerPostFrame(NSClientPlayer pp) { // Anything else? TSGameRules::PlayerPostFrame(pp); @@ -179,7 +179,7 @@ TSMultiplayerRules::PlayerPostFrame(base_player pp) void -TSMultiplayerRules::PlayerDisconnect(base_player pp) +TSMultiplayerRules::PlayerDisconnect(NSClientPlayer pp) { //TAGGG - no parent method call? Really? TSGameRules::PlayerDisconnect(pp); @@ -191,7 +191,7 @@ TSMultiplayerRules::PlayerDisconnect(base_player pp) void -TSMultiplayerRules::PlayerDeath(base_player pp) +TSMultiplayerRules::PlayerDeath(NSClientPlayer pp) { TSGameRules::PlayerDeath(pp); @@ -376,7 +376,7 @@ TSMultiplayerRules::PlayerDeath(base_player pp) float -TSMultiplayerRules::ConsoleCommand(base_player pp, string cmd) +TSMultiplayerRules::ConsoleCommand(NSClientPlayer pp, string cmd) { tokenize(cmd); @@ -662,7 +662,7 @@ TSMultiplayerRules::RestartRound(int iWipe) // From FreeCS, to check if all players on a team are dead for doing something // gamerules-wise like ending in the other side's favor. void -TSMultiplayerRules::DeathCheck(base_player pl) +TSMultiplayerRules::DeathCheck(NSClientPlayer pl) { @@ -777,7 +777,7 @@ Called whenever a player survived a round and needs a basic respawn. ================= */ void -TSMultiplayerRules::PlayerRespawn(base_player pp, int fTeam) +TSMultiplayerRules::PlayerRespawn(NSClientPlayer pp, int fTeam) { entity eSpawn; vector myOrigin; @@ -975,16 +975,9 @@ MakePlayable(entity targ) self = oself; } -static void -MakeSpectator(entity targ) -{ - entity oself = self; - self = targ; - spawnfunc_spectator(); - self = oself; -} + void -TSMultiplayerRules::PlayerMakePlayable(base_player pp) +TSMultiplayerRules::PlayerMakePlayable(NSClientPlayer pp) { player pl = (player)pp; @@ -998,7 +991,7 @@ TSMultiplayerRules::PlayerMakePlayable(base_player pp) void -TSMultiplayerRules::PlayerMakePlayableWithDefaultMoney(base_player pp){ +TSMultiplayerRules::PlayerMakePlayableWithDefaultMoney(NSClientPlayer pp){ player pl = (player)pp; PlayerMakePlayable(pp); setPlayerMoneyDefault(pl); @@ -1007,7 +1000,7 @@ TSMultiplayerRules::PlayerMakePlayableWithDefaultMoney(base_player pp){ void -TSMultiplayerRules::PlayerMakeSpectatorAndNotify(base_player pp){ +TSMultiplayerRules::PlayerMakeSpectatorAndNotify(NSClientPlayer pp){ PlayerMakeSpectator(pp); @@ -1021,7 +1014,7 @@ TSMultiplayerRules::PlayerMakeSpectatorAndNotify(base_player pp){ // Turns the player into a fake spectator (open buymenu and fire to spawn // when its closed) void -TSMultiplayerRules::PlayerMakeSpectator(base_player pp) +TSMultiplayerRules::PlayerMakeSpectator(NSClientPlayer pp) { player pl = (player)pp; @@ -1052,7 +1045,7 @@ TSMultiplayerRules::PlayerMakeSpectator(base_player pp) // Similar to above, but mimicks the FreeCS way of setting the // "think" to a tiny method that calls spawnfunc_spectator. void -TSMultiplayerRules::PlayerMakeSpectatorDelayed(base_player pp) +TSMultiplayerRules::PlayerMakeSpectatorDelayed(NSClientPlayer pp) { // Nevermind, this has no significance anymore with the client entity change no longer // happening. Redirect to the normal version @@ -1071,7 +1064,7 @@ Called on the client first joining the server. // NOTE - this is as said above, fist time connecting to a server. // NOT spawning ingame with collision, weapon viewmodel, seen by other players, etc. void -TSMultiplayerRules::PlayerSpawn(base_player pp) +TSMultiplayerRules::PlayerSpawn(NSClientPlayer pp) { player pl = (player)pp; @@ -1079,7 +1072,7 @@ TSMultiplayerRules::PlayerSpawn(base_player pp) // Apparently the player already arrives as a "player", a Nuclide-implemented event called // ClientConnect makes the client entity a "player" by using spawnfunc. - // Having the "player" class available that early makes me wonder why "base_player" is used so + // Having the "player" class available that early makes me wonder why "NSClientPlayer" is used so // often in implemented methods, but not an issue. // ClientConnect is called before PutClientInServer (the one that leads to the gamerules // PlayerSpawn, right here), just for info. diff --git a/src/server/gamerules_singleplayer.qc b/src/server/gamerules_singleplayer.qc index 0b5c918..cc5ac3b 100644 --- a/src/server/gamerules_singleplayer.qc +++ b/src/server/gamerules_singleplayer.qc @@ -20,7 +20,7 @@ // instead, 99% of the stuff does not care about being multiplayer. void -TSSingleplayerRules::PlayerDeath(base_player pp) +TSSingleplayerRules::PlayerDeath(NSClientPlayer pp) { TSGameRules::PlayerDeath(pp); @@ -62,7 +62,7 @@ TSSingleplayerRules::PlayerDeath(base_player pp) } void -TSSingleplayerRules::PlayerSpawn(base_player pp) +TSSingleplayerRules::PlayerSpawn(NSClientPlayer pp) { pp.classname = "player"; pp.health = pp.max_health = 100; diff --git a/src/shared/player.h b/src/shared/player.h index 4e208db..f683587 100644 --- a/src/shared/player.h +++ b/src/shared/player.h @@ -44,7 +44,7 @@ enum PLAYER_STATE{ #define SAVE_STATE_ARRAY_MEMBER(ary, i, sub) x ##_net = x // did not do */ -class player:base_player +class player:NSClientPlayer { #ifdef CLIENT diff --git a/src/shared/player.qc b/src/shared/player.qc index 6e72158..72ea847 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -87,7 +87,7 @@ void player::ReceiveEntity(float new, float fl) { /* the generic client attributes */ - base_player::ReceiveEntity(new, fl); + NSClientPlayer::ReceiveEntity(new, fl); @@ -395,7 +395,7 @@ player::PredictPreFrame(void) /* the generic client attributes */ - base_player::PredictPreFrame(); + NSClientPlayer::PredictPreFrame(); // client's way of calling prethink @@ -508,7 +508,7 @@ player::PredictPostFrame(void) /* the generic client attributes */ - base_player::PredictPostFrame(); + NSClientPlayer::PredictPostFrame(); // client's way of calling postthink postThink(); @@ -608,7 +608,7 @@ player::EvaluateEntity(void) { /* the generic client attributes */ - base_player::EvaluateEntity(); + NSClientPlayer::EvaluateEntity(); int i; int myAmmoType; @@ -789,7 +789,7 @@ player::SendEntity(entity ePEnt, float fChanged) WriteFloat(MSG_ENTITY, fChanged); /* the generic client attributes */ - base_player::SendEntity(ePEnt, fChanged); + NSClientPlayer::SendEntity(ePEnt, fChanged); int i; diff --git a/src/shared/pmove.qc b/src/shared/pmove.qc index f23435a..ab6c54b 100644 --- a/src/shared/pmove.qc +++ b/src/shared/pmove.qc @@ -25,7 +25,7 @@ // This file was the source of the "GamePMove_..." format physics methods. -// Now, the new base_player-overridable forms are used. +// Now, the new NSClientPlayer-overridable forms are used. // Also, some physics constants can be overridden like so: // #define PMOVE_STEPHEIGHT 18 @@ -35,7 +35,7 @@ // First something config-oriented. If uncommented, a modified clone of Nuclide's -// base_player::Physics_Crouch (overridden by player) is used to insert the checks for +// NSClientPlayer::Physics_Crouch (overridden by player) is used to insert the checks for // stopping uncrouching too soon after certain melee attacks. Example: katana melee attack. // Otherwise, a simpler way is done: in player::Physics_InputPreMove, force INPUT_BUTTON8 // if the uncrouch block has not expired. @@ -61,8 +61,8 @@ const vector VEC_CHULL_MAX = [16,16,18]; // Simplified view of major physics method changes: /* - PMove_Run -> base_player::Physics_Run - PMove_AccelJump -> base_player::Physics_CheckJump + PMove_Run -> NSClientPlayer::Physics_Run + PMove_AccelJump -> NSClientPlayer::Physics_CheckJump PMove_Acceleration -> PMoveCustom_Acceleration */ @@ -97,7 +97,7 @@ void TS_Physics_LedgeCheck(player pl); void player::Physics_Fall(float flDownforce) { - //base_player::Physics_Fall(flDownforce); + //NSClientPlayer::Physics_Fall(flDownforce); if (flDownforce > 580) { #ifdef SERVER @@ -127,7 +127,7 @@ player::Physics_Crouch(void) { #ifndef UNCROUCHBLOCK_FORKED // simple simple - base_player::Physics_Crouch(); + NSClientPlayer::Physics_Crouch(); #else // would this be better somewhere, in CSQC_InputFrame or Physics_InputPreMove? // probably the latter to make hacking less rewarding @@ -191,7 +191,7 @@ player::Physics_Crouch(void) void player::Physics_Jump(void) { - //base_player::Physics_Jump(); + //NSClientPlayer::Physics_Jump(); if (this.waterlevel >= 2) { @@ -230,7 +230,7 @@ player::Physics_Jump(void) void player::Physics_CheckJump(float premove) { - base_player::Physics_CheckJump(premove); + NSClientPlayer::Physics_CheckJump(premove); if(this.movetype == MOVETYPE_NOCLIP){ // no ledge checks @@ -247,14 +247,14 @@ player::Physics_CheckJump(float premove) void player::Physics_SetViewParms(void) { - base_player::Physics_SetViewParms(); + NSClientPlayer::Physics_SetViewParms(); } void player::Physics_WaterJump(void) { - base_player::Physics_WaterJump(); + NSClientPlayer::Physics_WaterJump(); } @@ -270,7 +270,7 @@ player::Physics_MaxSpeed(void) /* - float parentResult = base_player::Physics_MaxSpeed(); + float parentResult = NSClientPlayer::Physics_MaxSpeed(); return parentResult; */ @@ -320,7 +320,7 @@ player::Physics_MaxSpeed(void) void player::Physics_InputPreMove(void) { - base_player::Physics_InputPreMove(); + NSClientPlayer::Physics_InputPreMove(); // IDEA: is changing the speed by inputmove value adjusting better than changing // the max speed for prediction wonkiness (the camera looks to jump around on slowing down @@ -357,7 +357,7 @@ player::Physics_InputPreMove(void) void player::Physics_InputPostMove(void) { - base_player::Physics_InputPostMove(); + NSClientPlayer::Physics_InputPostMove(); } @@ -376,7 +376,7 @@ player::Physics_Run(void) this.friction = Game_GetFriction(this); // This call is pretty damn important - base_player::Physics_Run(); + NSClientPlayer::Physics_Run(); if(this.movetype == MOVETYPE_NOCLIP){ diff --git a/src/shared/pmove_water.qc b/src/shared/pmove_water.qc index d2cc83f..02efc07 100644 --- a/src/shared/pmove_water.qc +++ b/src/shared/pmove_water.qc @@ -15,7 +15,7 @@ */ //TAGGG - Clone of FreeHL's way, which is a clone of Nuclide's way -// (base_player::Physics_WaterMove). I'll keep this as a copy too then? +// (NSClientPlayer::Physics_WaterMove). I'll keep this as a copy too then? void diff --git a/src/shared/weapons.qc b/src/shared/weapons.qc index 4cd7a4e..bf8fc5a 100644 --- a/src/shared/weapons.qc +++ b/src/shared/weapons.qc @@ -1989,7 +1989,7 @@ weapon_precache(weapondata_basic_t* basePRef) // Not sure how to handle the "Weapons_UpdateAmmo" calls for FreeTS. // Guessing to leave them dummied as HUD drawing already knows where to grab clip and ammo-pool -// values from, the Nuclide base_player's ammo1, 2, 3 vars are never used. +// values from, the Nuclide NSClientPlayer's ammo1, 2, 3 vars are never used. //---------------------- // More typical way. /*