Use a global forcenewparms var for forcing new parms at episode end, so all players start with new parms, not just the one who exited first. Use ltime instead of cnt for client's time at spawn. Moved check for player spawn point to SelectSpawnPoint. Added some more protocol byte constants to defs.qc.
This commit is contained in:
parent
cf97e30f02
commit
341576570a
45
client.qc
45
client.qc
|
@ -19,6 +19,8 @@ float modelindex_eyes, modelindex_player;
|
|||
|
||||
float intermission_running;
|
||||
float intermission_exittime;
|
||||
// [slipyx] set for forcing new parms in decodeparms
|
||||
float forcenewparms;
|
||||
|
||||
/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
|
||||
This is the camera point for the intermission.
|
||||
|
@ -30,7 +32,8 @@ void() info_intermission =
|
|||
|
||||
void() SetChangeParms =
|
||||
{
|
||||
if (self.health <= 0)
|
||||
// [slipyx] allow forcenewparms too
|
||||
if (self.health <= 0 || (forcenewparms))
|
||||
{
|
||||
SetNewParms ();
|
||||
return;
|
||||
|
@ -81,7 +84,8 @@ void() DecodeLevelParms =
|
|||
{
|
||||
if (!deathmatch) // [slipyx] new episode fix
|
||||
{
|
||||
if (world.model == "maps/start.bsp")
|
||||
// [slipyx] allow forcenewparms too
|
||||
if (world.model == "maps/start.bsp" || (forcenewparms))
|
||||
SetNewParms (); // take away all stuff on starting new episode
|
||||
}
|
||||
|
||||
|
@ -317,6 +321,7 @@ void() changelevel_touch =
|
|||
nextmap = self.map;
|
||||
|
||||
// [slipyx] skip start after episode ends in coop
|
||||
forcenewparms = 0;
|
||||
if (coop && nextmap == "start")
|
||||
{
|
||||
if (mapname == "e1m7") nextmap = "e2m1";
|
||||
|
@ -325,7 +330,7 @@ void() changelevel_touch =
|
|||
if (mapname == "e4m7") nextmap = "end";
|
||||
if (mapname == "end") nextmap = "e1m1";
|
||||
if (mapname == "e5end") nextmap = "e5m1";
|
||||
other.health = 0; // for setnewparms
|
||||
forcenewparms = 1; // for setnewparms
|
||||
}
|
||||
|
||||
SUB_UseTargets ();
|
||||
|
@ -416,7 +421,7 @@ void() ClientKill =
|
|||
if (intermission_running) return;
|
||||
|
||||
bprint (self.netname);
|
||||
bprint (" goes commit die.\n");
|
||||
bprint (" suicides.\n");
|
||||
set_suicide_frame ();
|
||||
self.modelindex = modelindex_player;
|
||||
self.frags = self.frags - 2; // extra penalty
|
||||
|
@ -424,11 +429,6 @@ void() ClientKill =
|
|||
respawn ();
|
||||
};
|
||||
|
||||
float(vector v) CheckSpawnPoint =
|
||||
{
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
SelectSpawnPoint
|
||||
|
@ -442,6 +442,10 @@ entity() SelectSpawnPoint =
|
|||
local entity thing;
|
||||
local float pcount;
|
||||
|
||||
// [slipyx] check if player has a respawn point set
|
||||
if (coop && self.movetarget)
|
||||
return self.movetarget;
|
||||
|
||||
// testinfo_player_start is only found in regioned levels
|
||||
spot = find (world, classname, "testplayerstart");
|
||||
if (spot)
|
||||
|
@ -512,13 +516,7 @@ void() PutClientInServer =
|
|||
{
|
||||
local entity spot;
|
||||
|
||||
// [slipyx] check if placed a respawn point
|
||||
if (coop && self.movetarget)
|
||||
{
|
||||
spot = self.movetarget;
|
||||
}
|
||||
else
|
||||
spot = SelectSpawnPoint ();
|
||||
spot = SelectSpawnPoint ();
|
||||
|
||||
self.origin = self.oldorigin = spot.origin + '0 0 1'; // [slipyx] respawn where died fix?
|
||||
|
||||
|
@ -538,8 +536,8 @@ void() PutClientInServer =
|
|||
self.invincible_finished = 0;
|
||||
self.effects = 0;
|
||||
self.invincible_time = 0;
|
||||
// [slipyx] have cnt be the time at spawn
|
||||
self.cnt = time;
|
||||
// [slipyx] set ltime to the time at spawn
|
||||
self.ltime = time;
|
||||
|
||||
DecodeLevelParms ();
|
||||
|
||||
|
@ -554,8 +552,6 @@ void() PutClientInServer =
|
|||
// paustime is set by teleporters to keep the player from moving a while
|
||||
self.pausetime = 0;
|
||||
|
||||
// spot = SelectSpawnPoint ();
|
||||
|
||||
self.origin = spot.origin + '0 0 1';
|
||||
self.angles = spot.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
|
@ -586,7 +582,7 @@ void() PutClientInServer =
|
|||
|
||||
if (deathmatch || coop)
|
||||
{
|
||||
makevectors(self.angles);
|
||||
makevectors (self.angles);
|
||||
spawn_tfog (self.origin + v_forward*20);
|
||||
}
|
||||
|
||||
|
@ -810,7 +806,7 @@ void() PlayerJump =
|
|||
self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
|
||||
|
||||
self.flags = self.flags - FL_ONGROUND; // don't stairwalk
|
||||
|
||||
|
||||
self.button2 = 0;
|
||||
// player jumping sound
|
||||
sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);
|
||||
|
@ -828,7 +824,6 @@ WaterMove
|
|||
|
||||
void() WaterMove =
|
||||
{
|
||||
//dprint (ftos(self.waterlevel));
|
||||
if (self.movetype == MOVETYPE_NOCLIP)
|
||||
return;
|
||||
if (self.health < 0)
|
||||
|
@ -1400,8 +1395,6 @@ void(entity targ, entity attacker) ClientObituary =
|
|||
bprint (" was eviscerated by a Fiend\n");
|
||||
if (attacker.classname == "monster_dog")
|
||||
bprint (" was mauled by a Rottweiler\n");
|
||||
/*if (attacker.classname == "monster_dragon")
|
||||
bprint (" was fried by a Dragon\n");*/
|
||||
if (attacker.classname == "monster_enforcer")
|
||||
bprint (" was blasted by an Enforcer\n");
|
||||
if (attacker.classname == "monster_fish")
|
||||
|
@ -1420,8 +1413,6 @@ void(entity targ, entity attacker) ClientObituary =
|
|||
bprint (" was smashed by a Shambler\n");
|
||||
if (attacker.classname == "monster_tarbaby")
|
||||
bprint (" was slimed by a Spawn\n");
|
||||
/*if (attacker.classname == "monster_vomit")
|
||||
bprint (" was vomited on by a Vomitus\n");*/
|
||||
if (attacker.classname == "monster_wizard")
|
||||
bprint (" was scragged by a Scrag\n");
|
||||
if (attacker.classname == "monster_zombie")
|
||||
|
|
13
defs.qc
13
defs.qc
|
@ -332,6 +332,12 @@ vector VEC_HULL2_MIN = '-32 -32 -24';
|
|||
vector VEC_HULL2_MAX = '32 32 64';
|
||||
|
||||
// protocol bytes
|
||||
// [slipyx] added some more
|
||||
float SVC_SETVIEW = 5;
|
||||
float SVC_SETANGLE = 10;
|
||||
float SVC_CLIENTDATA = 15;
|
||||
float SVC_PARTICLE = 18;
|
||||
float SVC_DAMAGE = 19;
|
||||
float SVC_TEMPENTITY = 23;
|
||||
float SVC_KILLEDMONSTER = 27;
|
||||
float SVC_FOUNDSECRET = 28;
|
||||
|
@ -340,6 +346,13 @@ float SVC_FINALE = 31;
|
|||
float SVC_CDTRACK = 32;
|
||||
float SVC_SELLSCREEN = 33;
|
||||
|
||||
// [slipyx] add new fitz protocol bytes
|
||||
float SVC_SKYBOX = 37;
|
||||
float SVC_BF = 40;
|
||||
float SVC_FOG = 41;
|
||||
float SVC_SPAWNBASELINE2 = 42;
|
||||
float SVC_SPAWNSTATIC2 = 43;
|
||||
float SVC_SPAWNSTATICSOUND2 = 44;
|
||||
|
||||
float TE_SPIKE = 0;
|
||||
float TE_SUPERSPIKE = 1;
|
||||
|
|
|
@ -38,7 +38,7 @@ void() PlaceRespawn =
|
|||
local float tleft;
|
||||
|
||||
// check cooldowns
|
||||
tleft = self.cnt + cd - time; // after spawn
|
||||
tleft = self.ltime + cd - time; // after spawn
|
||||
|
||||
// after placement
|
||||
if (self.movetarget)
|
||||
|
@ -65,7 +65,7 @@ void() PlaceRespawn =
|
|||
}
|
||||
|
||||
self.movetarget = spawn ();
|
||||
setorigin (self.movetarget, self.origin);
|
||||
setorigin (self.movetarget, self.origin + (self.view_ofs / 2));
|
||||
self.movetarget.angles = self.angles;
|
||||
self.movetarget.classname = "player_respawn";
|
||||
setmodel (self.movetarget, "progs/s_light.spr");
|
||||
|
|
Loading…
Reference in New Issue