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,10 +487,9 @@ void() PutClientInServer = {
self.th_die = PlayerDie;
self.deadflag = DEAD_NO;
// paustime is set by teleporters to keep the player from moving a while
self.pausetime = 0;
// spot = SelectSpawnPoint();
// pausetime is set by teleporters to keep the player from moving for a bit
self.pausetime = 0;
self.origin = spot.origin + '0 0 1';
self.angles = spot.angles;
@ -718,6 +717,7 @@ WaterMove
============
*/
void() WaterMove = {
string water_snd;
if(self.movetype == MOVETYPE_NOCLIP || self.health < 0) {
return;
}
@ -751,8 +751,8 @@ void() WaterMove = {
return;
}
if(self.watertype == CONTENT_LAVA) {
// do damage
switch(self.watertype) {
case CONTENT_LAVA:
if(self.dmgtime < time) {
if(self.radsuit_finished > time) {
self.dmgtime = time + 1;
@ -761,31 +761,29 @@ void() WaterMove = {
}
T_Damage(self, world, world, 10 * self.waterlevel);
}
} else if(self.watertype == CONTENT_SLIME) {
// do damage
break;
case CONTENT_SLIME:
if(self.dmgtime < time && self.radsuit_finished < time) {
self.dmgtime = time + 1;
T_Damage(self, world, world, 4 * self.waterlevel);
}
break;
}
if(!(self.flags & FL_INWATER)) {
// player enter water sound
if(self.watertype == CONTENT_LAVA) {
sound(self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM);
}
if(self.watertype == CONTENT_WATER) {
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);
switch(self.watertype) {
case CONTENT_LAVA: water_snd = "player/inlava.wav"; break;
case CONTENT_WATER: water_snd = "player/inh2o.wav"; break;
case CONTENT_SLIME: water_snd = "player/slimbrn2.wav"; break;
}
sound(self, CHAN_BODY, water_snd, 1, ATTN_NORM);
self.flags = self.flags + FL_INWATER;
self.dmgtime = 0;
}
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;
}
makevectors(self.v_angle); // is this still used
CheckRules();
WaterMove();

View File

@ -52,15 +52,15 @@ entity msg_entity; // destination of single entity writes
// required prog functions
void() main; // only for testing
void() StartFrame;
void() StartFrame; // called every frame
void() PlayerPreThink;
void() PlayerPostThink;
void() PlayerPreThink; // called each frame on each client before physics
void() PlayerPostThink; // called each frame on each client after physics
void() ClientKill;
void() ClientConnect;
void() ClientKill; // called when the "kill" cmd is entered
void() ClientConnect; // called upon client "connect"
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
* saved off for restarts