clean up
This commit is contained in:
parent
bcac79a048
commit
af7d5bd846
|
@ -487,13 +487,12 @@ void() PutClientInServer = {
|
|||
self.th_die = PlayerDie;
|
||||
|
||||
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;
|
||||
|
||||
// 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
|
||||
|
||||
// oh, this is a hack!
|
||||
|
@ -718,6 +717,7 @@ WaterMove
|
|||
============
|
||||
*/
|
||||
void() WaterMove = {
|
||||
string water_snd;
|
||||
if(self.movetype == MOVETYPE_NOCLIP || self.health < 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -751,41 +751,39 @@ void() WaterMove = {
|
|||
return;
|
||||
}
|
||||
|
||||
if(self.watertype == CONTENT_LAVA) {
|
||||
// do damage
|
||||
if(self.dmgtime < time) {
|
||||
if(self.radsuit_finished > time) {
|
||||
self.dmgtime = time + 1;
|
||||
} else {
|
||||
self.dmgtime = time + 0.2;
|
||||
switch(self.watertype) {
|
||||
case CONTENT_LAVA:
|
||||
if(self.dmgtime < time) {
|
||||
if(self.radsuit_finished > time) {
|
||||
self.dmgtime = time + 1;
|
||||
} else {
|
||||
self.dmgtime = time + 0.2;
|
||||
}
|
||||
T_Damage(self, world, world, 10 * self.waterlevel);
|
||||
}
|
||||
T_Damage(self, world, world, 10 * self.waterlevel);
|
||||
}
|
||||
} else if(self.watertype == CONTENT_SLIME) {
|
||||
// do damage
|
||||
if(self.dmgtime < time && self.radsuit_finished < time) {
|
||||
self.dmgtime = time + 1;
|
||||
T_Damage(self, world, world, 4 * self.waterlevel);
|
||||
}
|
||||
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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user