r2173 - in branches/nexuiz-2.0/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Feb 7 13:20:37 EST 2007
Author: div0
Date: 2007-02-07 13:20:36 -0500 (Wed, 07 Feb 2007)
New Revision: 2173
Modified:
branches/nexuiz-2.0/data/default.cfg
branches/nexuiz-2.0/data/qcsrc/server/builtins.qh
branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
branches/nexuiz-2.0/data/qcsrc/server/ctf.qc
branches/nexuiz-2.0/data/qcsrc/server/defs.qh
branches/nexuiz-2.0/data/qcsrc/server/domination.qc
branches/nexuiz-2.0/data/qcsrc/server/extensions.qh
branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
branches/nexuiz-2.0/data/qcsrc/server/w_common.qc
Log:
merged LH's changes from trunk (droptofloor item/spawn related changes);
in 2.x, spawnpoints still droptofloor, in 3.x currently not
OPEN BUG: ammo boxes for RL sink a bit into the floor
Modified: branches/nexuiz-2.0/data/default.cfg
===================================================================
--- branches/nexuiz-2.0/data/default.cfg 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/default.cfg 2007-02-07 18:20:36 UTC (rev 2173)
@@ -415,14 +415,14 @@
set g_balance_laser_animtime 0.3
set g_balance_laser_lifetime 9
-set g_balance_shotgun_primary_bullets 10
-set g_balance_shotgun_primary_damage 6
+set g_balance_shotgun_primary_bullets 5
+set g_balance_shotgun_primary_damage 12
set g_balance_shotgun_primary_spread 0.07
set g_balance_shotgun_primary_refire 0.5
set g_balance_shotgun_primary_animtime 0.2
set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_secondary_bullets 10
-set g_balance_shotgun_secondary_damage 6
+set g_balance_shotgun_secondary_bullets 5
+set g_balance_shotgun_secondary_damage 12
set g_balance_shotgun_secondary_spread 0.07
set g_balance_shotgun_secondary_refire 1.35
set g_balance_shotgun_secondary_animtime 0.2
Modified: branches/nexuiz-2.0/data/qcsrc/server/builtins.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/builtins.qh 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/builtins.qh 2007-02-07 18:20:36 UTC (rev 2173)
@@ -32,7 +32,7 @@
void eprint (entity e) = #31;
float walkmove (float yaw, float dist) = #32;
-float droptofloor (float yaw, float dist) = #34;
+float droptofloor () = #34;
void lightstyle (float style, string value) = #35;
float rint (float v) = #36;
float floor (float v) = #37;
Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -716,8 +716,7 @@
bprint("\n");
- self.welcomemessage_time = time + cvar("welcome_message_time");
- self.welcomemessage_time2 = 0;
+ self.welcomemessage_time = 0;
stuffcmd(self, strcat("exec maps/", mapname, ".cfg\n"));
// TODO: is this being used for anything else than cd tracks?
Modified: branches/nexuiz-2.0/data/qcsrc/server/ctf.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/ctf.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/ctf.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -20,7 +20,7 @@
if(!self.t_length)
self.t_length = 119; // maximum frame
- setattachment(self, world, "");
+ setattachment(self, world, "");
self.mdl = self.model;
self.flags = FL_ITEM;
self.solid = SOLID_TRIGGER;
@@ -33,7 +33,7 @@
self.cnt = FLAG_BASE;
self.mangle = self.angles;
//self.effects = self.effects | EF_DIMLIGHT;
- if (!droptofloor(0, 0))
+ if (!droptofloor())
{
dprint("Flag fell out of level at ", vtos(self.origin), "\n");
remove(self);
@@ -56,7 +56,7 @@
void(entity e) RegenFlag =
{
- setattachment(e, world, "");
+ setattachment(e, world, "");
e.movetype = MOVETYPE_TOSS;
e.solid = SOLID_TRIGGER;
// TODO: play a sound here
Modified: branches/nexuiz-2.0/data/qcsrc/server/defs.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/defs.qh 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/defs.qh 2007-02-07 18:20:36 UTC (rev 2173)
@@ -178,7 +178,6 @@
.float welcomemessage_time;
-.float welcomemessage_time2;
.float version;
// stahl's voting
Modified: branches/nexuiz-2.0/data/qcsrc/server/domination.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/domination.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/domination.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -135,7 +135,7 @@
}
// if the player left the game, changed teams or became spectator, we have to find another player on the same team to give credit to
- if (!self.enemy.flags || self.enemy.team != self.goalentity.team || self.enemy.killcount == -666) // flags is zero on removed clients
+ if (!self.enemy.flags || self.enemy.team != self.goalentity.team || self.enemy.killcount == -666) // flags is zero on removed clients
{
other = self.enemy;
head = find(head, classname, "player");
@@ -288,7 +288,7 @@
self.flags = FL_ITEM;
setsize(self, '-32 -32 -32', '32 32 32');
setorigin(self, self.origin + '0 0 20');
- droptofloor(0, 0);
+ droptofloor();
};
Modified: branches/nexuiz-2.0/data/qcsrc/server/extensions.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/extensions.qh 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/extensions.qh 2007-02-07 18:20:36 UTC (rev 2173)
@@ -651,6 +651,13 @@
//description:
//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
+//DP_SV_PRINT
+//idea: id Software (QuakeWorld Server)
+//darkplaces implementation: Black, LordHavoc
+void(string s, ...) print = #339; // same number as in EXT_CSQC
+//description:
+//this is identical to dprint except that it always prints regardless of the developer cvar.
+
//DP_SV_SETCOLOR
//idea: LordHavoc
//darkplaces implementation: LordHavoc
Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -16,22 +16,27 @@
void(string s, float check_dangerous) ServerConsoleEcho =
{
local string ch;
- localcmd("echo \"");
- if(check_dangerous)
+ if (checkextension("DP_SV_PRINT"))
+ print(s, "\n");
+ else
{
- while(strlen(s))
+ localcmd("echo \"");
+ if(check_dangerous)
{
- ch = substring(s, 0, 1);
- if(ch != "\"" && ch != "\r" && ch != "\n")
- localcmd(ch);
- s = substring(s, 1, strlen(s) - 1);
+ while(strlen(s))
+ {
+ ch = substring(s, 0, 1);
+ if(ch != "\"" && ch != "\r" && ch != "\n")
+ localcmd(ch);
+ s = substring(s, 1, strlen(s) - 1);
+ }
}
+ else
+ {
+ localcmd(s);
+ }
+ localcmd("\"\n");
}
- else
- {
- localcmd(s);
- }
- localcmd("\"\n");
}
void(string s, float check_dangerous) GameLogEcho =
@@ -81,82 +86,26 @@
return a - (floor(a / b) * b);
}
-vector find_floor(vector org)
-{
- traceline(org + '0 0 5', org - '0 0 255', TRUE, self);
- if (trace_fraction < 1)
- return trace_endpos;
- else
- return org;
-}
-
void relocate_spawnpoint()
{
- vector org, loc;
- string error_msg;
+ vector o;
+ o = self.origin;
- error_msg = "spawn point too close to a wall";
+ setsize(self, PL_MIN, PL_MAX);
- org = find_floor(self.origin) + '0 0 30';
+ // nudge off the floor
+ setorigin(self, self.origin + '0 0 1');
- traceline(org, org - '18 0 0', TRUE, world);
- if(trace_fraction < 1)
+ tracebox(self.origin, PL_MIN, PL_MAX, self.origin, TRUE, self);
+ if (trace_startsolid)
{
- loc = trace_endpos;
- traceline(loc, loc + '36 0 0', TRUE, world);
- if(trace_fraction >= 1 && !self.noalign)
- org = loc + '18 0 0';
- else
- {
- objerror(error_msg);
- return;
- }
+ objerror("player spawn point in solid, mapper sucks!\n");
+ return;
}
- traceline (org, org - '-18 0 0', TRUE, world);
- if (trace_fraction < 1)
- {
- loc = trace_endpos;
- traceline (loc, loc + '-36 0 0', TRUE, world);
- if(trace_fraction >= 1 && !self.noalign)
- org = loc + '-18 0 0';
- else
- {
- objerror(error_msg);
- return;
- }
- }
-
- traceline (org, org - '0 18 0' , TRUE, world);
- if (trace_fraction < 1)
- {
- loc = trace_endpos;
- traceline (loc, loc + '0 36 0', TRUE, world);
- if(trace_fraction >= 1 && !self.noalign)
- org = loc + '0 18 0';
- else
- {
- objerror(error_msg);
- return;
- }
- }
-
- traceline (org, org - '0 -18 0', TRUE, world);
- if (trace_fraction < 1)
- {
- loc = trace_endpos;
- traceline (loc, loc + '0 -36 0', TRUE, world);
- if(trace_fraction >= 1 && !self.noalign)
- org = loc + '0 -18 0';
- else
- {
- objerror(error_msg);
- return;
- }
- }
-
- if(!self.noalign)
- setorigin(self, org);
+ // drop the spawn point onto the floor
+ // NOTE: a later version might not do this any more
+ droptofloor();
}
// NOTE: DO NOT USE THIS FUNCTION TOO OFTEN.
@@ -459,7 +408,7 @@
if(p.frags == -666)
return;
-
+
f = ceil(factor * p.frags);
p.frags = p.frags - f;
Modified: branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/runematch.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/runematch.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -39,7 +39,8 @@
return;
}
- setorigin(self, find_floor(self.origin) + '0 0 35');
+ droptofloor();
+ setorigin(self, self.origin + '0 0 35');
}
string RuneName(float r)
Modified: branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_items.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_items.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -227,40 +227,14 @@
.float is_item;
void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, string itemname, float itemid, float itemflags, float(entity player, entity item) pickupevalfunc, float pickupbasevalue)
{
- vector org;
- org = self.origin;
-
startitem_failed = FALSE;
- if (self.classname != "droppedweapon" && !self.noalign)
+ if (self.classname != "droppedweapon")
{
- vector z_offset;
-
- z_offset = '0 0 1';
-
- if (itemid == IT_SHELLS)
- z_offset = '0 0 4';
- else if (itemid == IT_ROCKETS)
- z_offset = '0 0 4';
- else if (itemid == IT_NAILS)
- z_offset = '0 0 0';
- else if (itemid == IT_25HP)
- z_offset = '0 0 5';
- else if (itemid == IT_ARMOR)
- z_offset = '0 0 3';
- else if (itemid == IT_SHOTGUN)
- z_offset = '0 0 10';
-
- org = find_floor(org) + z_offset;
- setorigin(self, org);
- }
-
- if(cvar("spawn_debug") >= 2)
- {
- if(self.classname != "droppedweapon")
+ if(cvar("spawn_debug") >= 2)
{
entity otheritem;
- for(otheritem = findradius(org, 3); otheritem; otheritem = otheritem.chain)
+ for(otheritem = findradius(self.origin, 3); otheritem; otheritem = otheritem.chain)
{
if(otheritem.is_item)
{
@@ -271,10 +245,9 @@
}
self.is_item = TRUE;
}
- }
- if (self.classname != "droppedweapon")
waypoint_spawnforitem(self);
+ }
if (!(cvar("g_pickup_items") && !cvar("g_nixnex")) && !cvar("g_minstagib") &&
itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
@@ -340,23 +313,19 @@
self.netname = itemname;
self.items = itemid;
self.flags = FL_ITEM | itemflags;
+ if (self.noalign)
+ self.movetype = MOVETYPE_NONE;
+ else
+ self.movetype = MOVETYPE_TOSS;
+ self.solid = SOLID_TRIGGER;
+ self.touch = Item_Touch;
setmodel (self, self.mdl);
+ setsize (self, '-16 -16 0', '16 16 32');
if (itemflags & FL_WEAPON)
{
- setorigin (self, self.origin + '0 0 23');
- setsize (self, '-12 -12 -12', '12 12 12');
-
// neutral team color for pickup weapons
self.colormap = 160 * 1024 + 160;
}
- else
- {
- setorigin (self, self.origin + '0 0 25');
- // setsize (self, '-8 -8 -5', '8 8 8');
- }
- self.movetype = MOVETYPE_TOSS;
- self.solid = SOLID_TRIGGER;
- self.touch = Item_Touch;
// Savage: remove thrown items after a certain period of time ("garbage collection")
if (self.classname == "droppedweapon")
@@ -364,10 +333,12 @@
self.think = RemoveItem;
self.nextthink = time + 60;
}
- else
+ else if (!self.noalign)
{
- self.movetype = MOVETYPE_NONE;
- setorigin(self, org);
+ // first nudge it off the floor a little bit to avoid math errors
+ setorigin(self, self.origin + '0 0 1');
+ // note droptofloor returns FALSE if stuck/or would fall too far
+ droptofloor();
}
if (cvar("g_fullbrightitems"))
Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -300,11 +300,19 @@
{
string s, mutator, modifications, padding;
- /*if(self.welcomemessage_time < time)
+ /*if(self.welcomemessage_time > time)
return;
- if(self.welcomemessage_time2 > time)
+ self.welcomemessage_time = time + 0.8; */
+
+ if(self.cvar_scr_centertime == 0) return;
+ if(self.welcomemessage_time > time) return;
+ self.welcomemessage_time = time + self.cvar_scr_centertime * 0.6;
+
+ if(cvar("g_campaign"))
+ {
+ centerprint(pl, campaign_message);
return;
- self.welcomemessage_time2 = time + 0.8; */
+ }
if(self.classname == "observer")
{
@@ -322,15 +330,6 @@
}
- if(self.welcomemessage_time2 > time) return;
- self.welcomemessage_time2 = time + 1.0;
-
- if(cvar("g_campaign"))
- {
- centerprint(pl, campaign_message);
- return;
- }
-
if(cvar("g_minstagib"))
mutator = "^2Minstagib ^1";
else if(cvar("g_instagib"))
Modified: branches/nexuiz-2.0/data/qcsrc/server/w_common.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_common.qc 2007-02-06 21:26:19 UTC (rev 2172)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_common.qc 2007-02-07 18:20:36 UTC (rev 2173)
@@ -134,7 +134,6 @@
void fireBullet (vector start, vector dir, float spread, float damage, float dtype, float tracer)
{
vector end;
- float r;
local entity e;
// use traceline_hitcorpse to make sure it can hit gibs and corpses too
@@ -167,13 +166,6 @@
te_gunshot (trace_endpos);
else
te_spike (trace_endpos);
- r = random ();
- if (r < 0.10)
- PointSound (trace_endpos, "weapons/ric1.ogg", 1, ATTN_NORM);
- else if (r < 0.20)
- PointSound (trace_endpos, "weapons/ric2.ogg", 1, ATTN_NORM);
- else if (r < 0.30)
- PointSound (trace_endpos, "weapons/ric3.ogg", 1, ATTN_NORM);
}
//else if (trace_ent.classname == "player" || trace_ent.classname == "corpse" || trace_ent.classname == "gib")
//stuffcmd(self, "play2 misc/hit.wav\n");
More information about the nexuiz-commits
mailing list