NSClientPlayer: Fix ladder climbing sounds from not playing.

This commit is contained in:
Marco Cawthorne 2022-11-10 15:41:42 -08:00
parent 841e89e2c5
commit bb92aaf37f
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
3 changed files with 16 additions and 15 deletions

View File

@ -899,7 +899,7 @@ NSClientPlayer::OptimiseChangedFlags(entity ePEnt, float flChanged)
flChanged &= ~PLAYER_AMMO1;
flChanged &= ~PLAYER_AMMO2;
flChanged &= ~PLAYER_AMMO3;
flChanged &= ~PLAYER_FLAGS;
//flChanged &= ~PLAYER_FLAGS;
flChanged &= ~PLAYER_PUNCHANGLE;
flChanged &= ~PLAYER_VIEWZOOM;
flChanged &= ~PLAYER_SPECTATE;
@ -1067,7 +1067,7 @@ NSClientPlayer::Footsteps_Update(void)
step_time = time + 2.0f;
} else {
/* make it so we step once we land */
if (!(flags & FL_ONGROUND) && !(flags & FL_ONLADDER)) {
if (!(GetFlags() & FL_ONGROUND) && !(GetFlags() & FL_ONLADDER)) {
step_time = 0.0f;
return;
}
@ -1080,9 +1080,9 @@ NSClientPlayer::Footsteps_Update(void)
traceline(origin + view_ofs, origin + [0,0,-48], FALSE, this);
tex_name = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos));
if (!(flags & FL_ONGROUND)) {
if (!(GetFlags() & FL_ONGROUND) && (!GetFlags() & FL_ONLADDER)) {
return;
} else if (flags & FL_ONLADDER) {
} else if (GetFlags() & FL_ONLADDER) {
if (step)
StartSoundDef("step_ladder.left", CHAN_BODY, true);
else

View File

@ -100,6 +100,15 @@ public:
/* overrides */
virtual void SpawnKey(string,string);
virtual void Spawned(void);
/** Handles what happens before the entity gets removed from the client game. */
virtual void OnRemoveEntity(void);
/** Tells the engine to make the entity static, effectively making it inaccessible.
It will be removed from the game-logic but remain visible and it will retain its
collision and maintain the appearance it had before getting removed. */
virtual void MakeStatic(void);
#ifdef SERVER
virtual void Respawn(void);
virtual void Input(entity,string,string);
@ -334,12 +343,4 @@ public:
of any entity class that you want to support think functions in.
This saves you the effort of writing your own routines and methods. */
nonvirtual void HandleThink(void);
/** Handles what happens before the entity gets removed from the client game. */
virtual void OnRemoveEntity(void);
/** Tells the engine to make the entity static, effectively making it inaccessible.
It will be removed from the game-logic but remain visible and it will retain its
collision and maintain the appearance it had before getting removed. */
virtual void MakeStatic(void);
};

View File

@ -28,7 +28,7 @@ Materials_LoadFromText(string filename)
fileMaterial = fopen(filename, FILE_READ);
if (fileMaterial >= 0) {
print(strcat("parsing material assignments from ", filename,"\n"));
//print(strcat("parsing material assignments from ", filename,"\n"));
while ((sTemp = fgets(fileMaterial))) {
/* tokenize and just parse this stuff in */
@ -67,7 +67,7 @@ Materials_LoadFromMat(string filename)
if (command == "surfaceprop") {
hash_add(g_hashMaterials, materialname, parameters, EV_STRING);
print(sprintf("added Material %S type %S\n", materialname, parameters));
//print(sprintf("added Material %S type %S\n", materialname, parameters));
break;
}
}
@ -162,7 +162,7 @@ Materials_LoadFromLegacyText(string filename)
fileMaterial = fopen(filename, FILE_READ);
if (fileMaterial >= 0) {
print(strcat("parsing material definitions from ", filename,"\n"));
//print(strcat("parsing material definitions from ", filename,"\n"));
while ((sTemp = fgets(fileMaterial))) {
/* tokenize and just parse this stuff in */
if (tokenize_console(sTemp) == 2) {