This commit is contained in:
alison wright 2019-09-20 19:54:53 -04:00
parent bcac79a048
commit af7d5bd846
2 changed files with 33 additions and 37 deletions

View File

@ -487,13 +487,12 @@ void() PutClientInServer = {
self.th_die = PlayerDie; self.th_die = PlayerDie;
self.deadflag = DEAD_NO; self.deadflag = DEAD_NO;
// paustime is set by teleporters to keep the player from moving a while
// pausetime is set by teleporters to keep the player from moving for a bit
self.pausetime = 0; self.pausetime = 0;
// spot = SelectSpawnPoint(); self.origin = spot.origin + '0 0 1';
self.angles = spot.angles;
self.origin = spot.origin + '0 0 1';
self.angles = spot.angles;
self.fixangle = TRUE; // turn this way immediately self.fixangle = TRUE; // turn this way immediately
// oh, this is a hack! // oh, this is a hack!
@ -718,6 +717,7 @@ WaterMove
============ ============
*/ */
void() WaterMove = { void() WaterMove = {
string water_snd;
if(self.movetype == MOVETYPE_NOCLIP || self.health < 0) { if(self.movetype == MOVETYPE_NOCLIP || self.health < 0) {
return; return;
} }
@ -751,41 +751,39 @@ void() WaterMove = {
return; return;
} }
if(self.watertype == CONTENT_LAVA) { switch(self.watertype) {
// do damage case CONTENT_LAVA:
if(self.dmgtime < time) { if(self.dmgtime < time) {
if(self.radsuit_finished > time) { if(self.radsuit_finished > time) {
self.dmgtime = time + 1; self.dmgtime = time + 1;
} else { } else {
self.dmgtime = time + 0.2; self.dmgtime = time + 0.2;
}
T_Damage(self, world, world, 10 * self.waterlevel);
} }
T_Damage(self, world, world, 10 * self.waterlevel); break;
} case CONTENT_SLIME:
} else if(self.watertype == CONTENT_SLIME) { if(self.dmgtime < time && self.radsuit_finished < time) {
// do damage self.dmgtime = time + 1;
if(self.dmgtime < time && self.radsuit_finished < time) { T_Damage(self, world, world, 4 * self.waterlevel);
self.dmgtime = time + 1; }
T_Damage(self, world, world, 4 * self.waterlevel); break;
}
} }
if(!(self.flags & FL_INWATER)) { if(!(self.flags & FL_INWATER)) {
// player enter water sound // player enter water sound
if(self.watertype == CONTENT_LAVA) { switch(self.watertype) {
sound(self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); case CONTENT_LAVA: water_snd = "player/inlava.wav"; break;
} case CONTENT_WATER: water_snd = "player/inh2o.wav"; break;
if(self.watertype == CONTENT_WATER) { case CONTENT_SLIME: water_snd = "player/slimbrn2.wav"; break;
sound(self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM);
}
if(self.watertype == CONTENT_SLIME) {
sound(self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM);
} }
sound(self, CHAN_BODY, water_snd, 1, ATTN_NORM);
self.flags = self.flags + FL_INWATER; self.flags = self.flags + FL_INWATER;
self.dmgtime = 0; self.dmgtime = 0;
} }
if(!(self.flags & FL_WATERJUMP)) { if(!(self.flags & FL_WATERJUMP)) {
self.velocity = self.velocity - 0.8 * self.waterlevel * frametime * self.velocity; self.velocity -= 0.8 * self.waterlevel * frametime * self.velocity;
} }
}; };
@ -833,8 +831,6 @@ void() PlayerPreThink = {
return; return;
} }
makevectors(self.v_angle); // is this still used
CheckRules(); CheckRules();
WaterMove(); WaterMove();

View File

@ -52,15 +52,15 @@ entity msg_entity; // destination of single entity writes
// required prog functions // required prog functions
void() main; // only for testing void() main; // only for testing
void() StartFrame; void() StartFrame; // called every frame
void() PlayerPreThink; void() PlayerPreThink; // called each frame on each client before physics
void() PlayerPostThink; void() PlayerPostThink; // called each frame on each client after physics
void() ClientKill; void() ClientKill; // called when the "kill" cmd is entered
void() ClientConnect; void() ClientConnect; // called upon client "connect"
void() PutClientInServer; // call after setting the parm1... parms void() PutClientInServer; // call after setting the parm1... parms
void() ClientDisconnect; void() ClientDisconnect; // called upon client "disconnect"
/* called when a client first connects to a server. sets parms so they can be /* called when a client first connects to a server. sets parms so they can be
* saved off for restarts * saved off for restarts