diff --git a/src/shared/NSClientPlayer.qc b/src/shared/NSClientPlayer.qc index bf795787..2b8db35b 100644 --- a/src/shared/NSClientPlayer.qc +++ b/src/shared/NSClientPlayer.qc @@ -1167,6 +1167,7 @@ NSClientPlayer::Footsteps_Update(void) StartSoundDef("step_slosh.right", CHAN_BODY, true); step_time = time + 0.35f; + return; } else if (waterlevel == 2) { if (step) StartSoundDef("step_wade.left", CHAN_BODY, true); @@ -1174,6 +1175,7 @@ NSClientPlayer::Footsteps_Update(void) StartSoundDef("step_wade.right", CHAN_BODY, true); step_time = time + 1.0f; + return; } else if (waterlevel == 3) { if (step) StartSoundDef("step_swim.left", CHAN_BODY, true); @@ -1181,6 +1183,7 @@ NSClientPlayer::Footsteps_Update(void) StartSoundDef("step_swim.right", CHAN_BODY, true); step_time = time + 2.0f; + return; } else { /* make it so we step once we land */ if (HasFlags(FL_ONGROUND | FL_ONLADDER) == false) { diff --git a/src/shared/player_pmove.qc b/src/shared/player_pmove.qc index 5d1ff9b4..ac4c98fd 100644 --- a/src/shared/player_pmove.qc +++ b/src/shared/player_pmove.qc @@ -241,6 +241,28 @@ NSClientPlayer::Physics_WaterMove(void) return; } +#ifdef SERVER + if (WaterLevel() > 0) { + print(sprintf("level: %d type: %d\n", waterlevel, watertype)); + + if (watertype == CONTENT_LAVA) { + print("in lava\n"); + if (m_flPainTime < time) { + Damage_Apply(this, world, 10 * WaterLevel(), 0, DMG_BURN); + m_flPainTime = time + 0.2; + print("lava damage\n"); + } + } else if (watertype == CONTENT_SLIME) { + print("in slime\n"); + if (m_flPainTime < time) { + Damage_Apply(this, world, 4 * WaterLevel(), 0, DMG_ACID); + m_flPainTime = time + 1; + print("slime damage\n"); + } + } + } +#endif + /* we've just exited water */ if (WaterLevel() != 3) { if (m_flUnderwaterTime < time) { @@ -258,6 +280,8 @@ NSClientPlayer::Physics_WaterMove(void) } #endif + + if (!WaterLevel()){ if (GetFlags() & FL_INWATER) { #ifdef SERVER @@ -268,20 +292,6 @@ NSClientPlayer::Physics_WaterMove(void) return; } -#ifdef SERVER - if (watertype == CONTENT_LAVA) { - if (m_flPainTime < time) { - Damage_Apply(this, world, 10 * WaterLevel(), 0, DMG_BURN); - m_flPainTime = time + 0.2; - } - } else if (watertype == CONTENT_SLIME) { - if (m_flPainTime < time) { - Damage_Apply(this, world, 4 * WaterLevel(), 0, DMG_ACID); - m_flPainTime = time + 1; - } - } -#endif - if (!(GetFlags() & FL_INWATER)) { #ifdef SERVER Sound_Play(this, CHAN_BODY, "player.waterenter"); diff --git a/src/shared/pmove_custom.qc b/src/shared/pmove_custom.qc index af8d148f..f503fb5c 100644 --- a/src/shared/pmove_custom.qc +++ b/src/shared/pmove_custom.qc @@ -56,7 +56,7 @@ PMoveCustom_Contents(vector org) { int oldhitcontents = self.hitcontentsmaski; self.hitcontentsmaski = -1; - traceline(org, org, TRUE, self); + traceline(org, org, MOVE_EVERYTHING, self); self.hitcontentsmaski = oldhitcontents; return trace_endcontentsi; } @@ -78,6 +78,7 @@ PMoveCustom_Categorize(void) { int contents; bool inladder = false; + vector testPos; tracebox(self.origin, self.mins, self.maxs, self.origin - [0,0,1], MOVE_NORMAL, self); @@ -134,7 +135,8 @@ PMoveCustom_Categorize(void) self.flags &= ~FL_ONLADDER; } - contents = PMoveCustom_Contents(self.origin + self.mins + [0,0,1]); + testPos = self.origin + [0, 0, self.mins[2] + 4]; + contents = PMoveCustom_Contents(testPos); if (contents & CONTENTBIT_WATER) { contents = CONTENT_WATER; @@ -142,11 +144,14 @@ PMoveCustom_Categorize(void) contents = CONTENT_SLIME; } else if (contents & CONTENTBIT_LAVA) { contents = CONTENT_LAVA; + } else { + contents = CONTENT_EMPTY; } /* how far underwater are we? */ if (contents < CONTENT_SOLID && !(self.flags & FL_ONLADDER)) { self.watertype = contents; + if (PMoveCustom_Contents(self.origin + (self.mins + self.maxs) * 0.5) & CONTENTBITS_FLUID) {