Get rid of pmove_water.qc and all that.

This commit is contained in:
Marco Cawthorne 2022-07-14 21:29:53 -07:00
parent 5ad849697e
commit 2f8b36c499
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
4 changed files with 18 additions and 98 deletions

View File

@ -5,7 +5,6 @@ weapon_common.h
animations.h
animations.qc
pmove.qc
pmove_water.qc
fx_blood.qc
fx_breakmodel.qc

View File

@ -1,78 +0,0 @@
/*
* Copyright (c) 2016-2022 Vera Visions LLC.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
GamePMove_WaterMove(player target)
{
if (target.movetype == MOVETYPE_NOCLIP) {
return;
}
#ifdef SERVER
if (target.health < 0) {
return;
}
/* we've just exited water */
if (target.waterlevel != 3) {
if (target.underwater_time < time) {
Sound_Play(target, CHAN_BODY, "player.gasplight");
} else if (target.underwater_time < time + 9) {
Sound_Play(target, CHAN_BODY, "player.gaspheavy");
}
target.underwater_time = time + 12;
} else if (target.underwater_time < time) {
/* we've been underwater... for too long. */
if (target.pain_time < time) {
Damage_Apply(target, world, 5, 0, DMG_DROWN);
target.pain_time = time + 1;
}
}
#endif
if (!target.waterlevel){
if (target.flags & FL_INWATER) {
#ifdef SERVER
Sound_Play(target, CHAN_BODY, "player.waterexit");
#endif
target.flags &= ~FL_INWATER;
}
return;
}
#ifdef SERVER
if (target.watertype == CONTENT_LAVA) {
if (target.pain_time < time) {
target.pain_time = time + 0.2;
Damage_Apply(target, world, 10*target.waterlevel, 0, DMG_BURN);
}
} else if (target.watertype == CONTENT_SLIME) {
if (target.pain_time < time) {
target.pain_time = time + 1;
Damage_Apply(target, world, 4*target.waterlevel, 0, DMG_ACID);
}
}
#endif
if (!(target.flags & FL_INWATER)) {
#ifdef SERVER
Sound_Play(target, CHAN_BODY, "player.waterenter");
target.pain_time = 0;
#endif
target.flags |= FL_INWATER;
}
}

View File

@ -101,9 +101,9 @@ NSClientPlayer:NSClientSpectator
int step;
float step_time;
float underwater_time;
float underwater_dmg;
float pain_time;
float m_flUnderwaterTime;
//float underwater_dmg;
float m_flPainTime;
entity last_used;

View File

@ -240,17 +240,17 @@ NSClientPlayer::Physics_WaterMove(void)
/* we've just exited water */
if (WaterLevel() != 3) {
if (underwater_time < time) {
if (m_flUnderwaterTime < time) {
Sound_Play(this, CHAN_BODY, "player.gasplight");
} else if (underwater_time < time + 9) {
} else if (m_flUnderwaterTime < time + 9) {
Sound_Play(this, CHAN_BODY, "player.gaspheavy");
}
underwater_time = time + 12;
} else if (underwater_time < time) {
m_flUnderwaterTime = time + 12;
} else if (m_flUnderwaterTime < time) {
/* we've been underwater... for too long. */
if (pain_time < time) {
if (m_flPainTime < time) {
Damage_Apply(this, world, 5, 0, DMG_DROWN);
pain_time = time + 1;
m_flPainTime = time + 1;
}
}
#endif
@ -267,14 +267,14 @@ NSClientPlayer::Physics_WaterMove(void)
#ifdef SERVER
if (WaterLevel() == CONTENT_LAVA) {
if (pain_time < time) {
pain_time = time + 0.2;
Damage_Apply(this, world, 10 * waterlevel, 0, DMG_BURN);
if (m_flPainTime < time) {
Damage_Apply(this, world, 10 * WaterLevel(), 0, DMG_BURN);
m_flPainTime = time + 0.2;
}
} else if (WaterLevel() == CONTENT_SLIME) {
if (pain_time < time) {
pain_time = time + 1;
Damage_Apply(this, world, 4 * waterlevel, 0, DMG_ACID);
if (m_flPainTime < time) {
Damage_Apply(this, world, 4 * WaterLevel(), 0, DMG_ACID);
m_flPainTime = time + 1;
}
}
#endif
@ -282,7 +282,7 @@ NSClientPlayer::Physics_WaterMove(void)
if (!(GetFlags() & FL_INWATER)) {
#ifdef SERVER
Sound_Play(this, CHAN_BODY, "player.waterenter");
pain_time = 0;
m_flPainTime = 0;
#endif
AddFlags(FL_INWATER);
}
@ -347,8 +347,7 @@ NSClientPlayer::Physics_InputPostMove(void)
Animation_TimerUpdate((player)this, input_timelength);
Animation_PlayerUpdate((player)this);
flags &= ~FL_FROZEN;
RemoveFlags(FL_FROZEN);
ClientInput();
}
@ -417,7 +416,7 @@ NSClientPlayer::Physics_Run(void)
dest = src + v_forward * 64;
traceline(src, dest, MOVE_NORMAL, this);
flags &= ~FL_ONUSABLE;
RemoveFlags(FL_ONUSABLE);
if (trace_ent.identity == 1) {
NSEntity foo = (NSEntity)trace_ent;
if (foo.PlayerUse) {