r4650 - in branches/nexuiz-2.0: . Docs/server/rcon2irc data data/gfx data/gfx/menu/silver data/qcsrc/client data/qcsrc/common data/qcsrc/menu data/qcsrc/menu/item data/qcsrc/menu/nexuiz data/qcsrc/server data/scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Oct 7 03:55:46 EDT 2008


Author: div0
Date: 2008-10-07 03:55:43 -0400 (Tue, 07 Oct 2008)
New Revision: 4650

Added:
   branches/nexuiz-2.0/data/gfx/crosshair12.tga
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_radar.c
Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/gfx/menu/silver/background_ingame.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_d.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_d.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/border.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/button_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/button_d.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/button_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/button_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_d.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_c0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_c1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_d0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_d1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_f0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_f1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_n0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_n1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/checkmark.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/closebutton_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/closebutton_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/closebutton_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/colorbutton_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/colorbutton_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/colorbutton_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/crosshairbutton_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/crosshairbutton_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/crosshairbutton_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/cursor.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/inputbox_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/inputbox_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_c0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_c1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_d0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_d1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_f0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_f1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_n0.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_n1.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_s.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/slider_c.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/slider_d.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/slider_f.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/slider_n.tga
   branches/nexuiz-2.0/data/gfx/menu/silver/slider_s.tga
   branches/nexuiz-2.0/data/qcsrc/client/Main.qc
   branches/nexuiz-2.0/data/qcsrc/client/View.qc
   branches/nexuiz-2.0/data/qcsrc/client/csqc_constants.qc
   branches/nexuiz-2.0/data/qcsrc/client/main.qh
   branches/nexuiz-2.0/data/qcsrc/client/ons.qc
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc
   branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc
   branches/nexuiz-2.0/data/qcsrc/common/constants.qh
   branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc
   branches/nexuiz-2.0/data/qcsrc/common/util.qc
   branches/nexuiz-2.0/data/qcsrc/common/util.qh
   branches/nexuiz-2.0/data/qcsrc/menu/classes.c
   branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_input.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/mainwindow.c
   branches/nexuiz-2.0/data/qcsrc/menu/skin-customizables.inc
   branches/nexuiz-2.0/data/qcsrc/server/arena.qc
   branches/nexuiz-2.0/data/qcsrc/server/bots.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
   branches/nexuiz-2.0/data/qcsrc/server/clientcommands.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/ent_cs.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
   branches/nexuiz-2.0/data/qcsrc/server/portals.qc
   branches/nexuiz-2.0/data/qcsrc/server/portals.qh
   branches/nexuiz-2.0/data/qcsrc/server/race.qc
   branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
   branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc
   branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
   branches/nexuiz-2.0/data/qcsrc/server/w_porto.qc
   branches/nexuiz-2.0/data/qcsrc/server/waypointsprites.qc
   branches/nexuiz-2.0/data/scripts/entities.def
Log:
r4620 | div0 | 2008-10-04 13:21:08 +0200 (Sat, 04 Oct 2008) | 2 lines
fix timelimit display after ready-restart (no longer 20.166666667)
r4621 | div0 | 2008-10-04 15:59:32 +0200 (Sat, 04 Oct 2008) | 2 lines
use the new mipmap drawflag
r4622 | div0 | 2008-10-04 16:32:14 +0200 (Sat, 04 Oct 2008) | 2 lines
cl_teamradar_size cvar
r4623 | div0 | 2008-10-04 20:08:22 +0200 (Sat, 04 Oct 2008) | 2 lines
more teamradar features (zoom mode)
r4624 | m0rfar | 2008-10-04 20:23:26 +0200 (Sat, 04 Oct 2008) | 1 line
Better alpha on silver skin. Still looks about the same :P
r4625 | div0 | 2008-10-04 20:44:07 +0200 (Sat, 04 Oct 2008) | 2 lines
fix wrong observe message
r4626 | div0 | 2008-10-04 21:47:01 +0200 (Sat, 04 Oct 2008) | 2 lines
ignore "trace_endpos in solid" error as it sometimes can actually happen
r4627 | div0 | 2008-10-04 22:16:03 +0200 (Sat, 04 Oct 2008) | 2 lines
fix hook bug, but why?
r4628 | div0 | 2008-10-04 22:30:37 +0200 (Sat, 04 Oct 2008) | 2 lines
fix MrBougo's portal bug
r4629 | div0 | 2008-10-04 22:38:24 +0200 (Sat, 04 Oct 2008) | 2 lines
cl_teamradar_position
r4630 | div0 | 2008-10-04 22:45:13 +0200 (Sat, 04 Oct 2008) | 2 lines
try to detect missing minimap and show no radar
r4631 | div0 | 2008-10-04 23:04:07 +0200 (Sat, 04 Oct 2008) | 2 lines
let HUD draw over other stuff
r4632 | div0 | 2008-10-04 23:31:26 +0200 (Sat, 04 Oct 2008) | 2 lines
do not use "chain" that way!
r4633 | div0 | 2008-10-04 23:46:08 +0200 (Sat, 04 Oct 2008) | 2 lines
draw HUD before other stuff again (no idea why this is needed)
r4634 | div0 | 2008-10-05 11:58:24 +0200 (Sun, 05 Oct 2008) | 2 lines
work around engine crash by drawing 2D polygons after R_RenderView() (i.e. forcing some DrawQ call before)
r4635 | div0 | 2008-10-05 11:59:07 +0200 (Sun, 05 Oct 2008) | 2 lines
forgot this file
r4636 | div0 | 2008-10-05 12:10:39 +0200 (Sun, 05 Oct 2008) | 2 lines
iapply the vid_conwidth/height ratio for the sprites
r4637 | div0 | 2008-10-05 13:03:48 +0200 (Sun, 05 Oct 2008) | 2 lines
do not generate that many porto weapons :P
r4638 | div0 | 2008-10-05 17:07:26 +0200 (Sun, 05 Oct 2008) | 2 lines
also copy weapon and switchweapon to spectators
r4639 | div0 | 2008-10-05 17:15:26 +0200 (Sun, 05 Oct 2008) | 2 lines
fix assault brush entities
r4640 | div0 | 2008-10-05 17:47:19 +0200 (Sun, 05 Oct 2008) | 2 lines
fix a broken check by commenting it out. It never was needed to begin with :P
r4641 | div0 | 2008-10-05 20:25:00 +0200 (Sun, 05 Oct 2008) | 2 lines
fix vote display
r4642 | div0 | 2008-10-06 10:10:00 +0200 (Mon, 06 Oct 2008) | 2 lines
added a new crosshair 12 (idea by tweak)
r4643 | div0 | 2008-10-06 11:54:41 +0200 (Mon, 06 Oct 2008) | 2 lines
hidewaypoints is handled by client now
r4644 | div0 | 2008-10-06 12:05:38 +0200 (Mon, 06 Oct 2008) | 2 lines
improve error message for size line
r4645 | div0 | 2008-10-06 15:18:46 +0200 (Mon, 06 Oct 2008) | 2 lines
also compare the team in SPRITERULE_DEFAULT. Should make it possible to hide a waypoint when changing teams, even if CEFC can't disable it yet (because no other update happens).
r4646 | div0 | 2008-10-06 15:21:54 +0200 (Mon, 06 Oct 2008) | 2 lines
experimental change: only resend a waypointsprite if its origin (or its carrier's) actually changed. Please test this in CTF when your flag carrier does not move and you change team. Should work because of the latest CSQC code change.
r4647 | div0 | 2008-10-06 18:58:41 +0200 (Mon, 06 Oct 2008) | 2 lines
updated entcs, less of a bandwidth hog
r4648 | div0 | 2008-10-06 19:52:54 +0200 (Mon, 06 Oct 2008) | 2 lines
minor portals fix again :P
r4649 | div0 | 2008-10-07 08:02:50 +0200 (Tue, 07 Oct 2008) | 2 lines
team radar menu controls

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/.patchsets	2008-10-07 07:55:43 UTC (rev 4650)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-4618
+revisions_applied = 1-4649

Modified: branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl
===================================================================
--- branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/Docs/server/rcon2irc/rcon2irc.pl	2008-10-07 07:55:43 UTC (rev 4650)
@@ -1014,7 +1014,7 @@
 	[ dp => q{:vote:vcall:(\d+):(.*)} => sub {
 		my ($id, $command) = @_;
 		$command = color_dp2irc $command;
-		my $oldnick = $store{"playernick_$id"};
+		my $oldnick = $id ? $store{"playernick_$id"} : "(console)";
 		out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 calls a vote for \"$command\017\"";
 		return 0;
 	} ],
@@ -1022,7 +1022,7 @@
 	# chat: Nexuiz server -> IRC channel, vote stop
 	[ dp => q{:vote:vstop:(\d+)} => sub {
 		my ($id) = @_;
-		my $oldnick = $store{"playernick_$id"};
+		my $oldnick = $id ? $store{"playernick_$id"} : "(console)";
 		out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 stopped the vote";
 		return 0;
 	} ],
@@ -1030,7 +1030,7 @@
 	# chat: Nexuiz server -> IRC channel, master login
 	[ dp => q{:vote:vlogin:(\d+)} => sub {
 		my ($id) = @_;
-		my $oldnick = $store{"playernick_$id"};
+		my $oldnick = $id ? $store{"playernick_$id"} : "(console)";
 		out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 logged in as master";
 		return 0;
 	} ],
@@ -1038,7 +1038,7 @@
 	# chat: Nexuiz server -> IRC channel, master do
 	[ dp => q{:vote:vdo:(\d+):(.*)} => sub {
 		my ($id, $command) = @_;
-		my $oldnick = $store{"playernick_$id"};
+		my $oldnick = $id ? $store{"playernick_$id"} : "(console)";
 		out irc => 0, "PRIVMSG $config{irc_channel} :* $oldnick\017 used his master status to do \"$command\017\"";
 		return 0;
 	} ],

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2008-10-07 07:55:43 UTC (rev 4650)
@@ -870,6 +870,7 @@
 set g_waypointsprite_deadlifetime 1
 set g_waypointsprite_limitedrange 5120
 set g_waypointsprite_stuffbinds 0
+set g_waypointsprite_scale 1
 alias "g_waypointsprite_personal"       "impulse 30"
 alias "g_waypointsprite_personal_p"     "impulse 31"
 alias "g_waypointsprite_personal_d"     "impulse 32"
@@ -1147,4 +1148,7 @@
 seta cl_teamradar_background_alpha 0.75 // set to -1 to disable
 seta cl_teamradar_scale 4096
 seta cl_teamradar_rotation 0 // rotation mode: you set what points up. 0 = player, 1 = west, 2 = south, 3 = east, 4 = north
+seta cl_teamradar_size "128 128"
+seta cl_teamradar_position "0 0" // 1 1 would be lower right corner, 0.5 0.5 the center (ARGH) :P
+seta cl_teamradar_zoommode 0 // zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out
 alias cl_teamradar_rotate "toggle cl_teamradar_rotation 0 1 2 3 4"

Copied: branches/nexuiz-2.0/data/gfx/crosshair12.tga (from rev 4649, trunk/data/gfx/crosshair12.tga)
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/background_ingame.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_d.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbutton_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_d.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/bigbuttongray_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/border.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/button_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/button_d.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/button_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/button_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_d.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/buttongray_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_c0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_c1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_d0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_d1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_f0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_f1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_n0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkbox_n1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/checkmark.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/closebutton_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/closebutton_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/closebutton_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/colorbutton_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/colorbutton_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/colorbutton_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/crosshairbutton_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/crosshairbutton_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/crosshairbutton_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/cursor.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/inputbox_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/inputbox_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_c0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_c1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_d0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_d1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_f0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_f1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_n0.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/radiobutton_n1.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/scrollbar_s.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/slider_c.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/slider_d.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/slider_f.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/slider_n.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/gfx/menu/silver/slider_s.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/qcsrc/client/Main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -37,9 +37,6 @@
 {
 };
 
-// let's make this a general data buffer...
-float using_gps;
-
 #ifdef USE_FTE
 float __engine_check;
 #endif
@@ -55,7 +52,7 @@
 }
 
 string forcefog;
-void WaypointSprite_Init();
+void WaypointSprite_Load();
 void CSQC_Init(void)
 {
 #ifdef USE_FTE
@@ -82,7 +79,6 @@
 	menu_visible = FALSE;
 	menu_show = menu_show_error;
 	menu_action = menu_sub_null;
-	using_gps = false;
 	maxclients = 255; // we later get the real maxclients to speed up stuff
 	//ctf_temp_1 = "";
 	// localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
@@ -102,8 +98,6 @@
 
 	gametype = 0;
 
-	gps_start = world;
-
 	// sbar_fields uses strunzone on the titles!
 	for(i = 0; i < MAX_SBAR_FIELDS; ++i)
 		sbar_title[i] = strzone("(null)");
@@ -135,7 +129,7 @@
 	if(v_y - 240 > -1)
 		cs_project_is_b0rked = FALSE;
 
-	WaypointSprite_Init();
+	WaypointSprite_Load();
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
@@ -349,11 +343,10 @@
 // BEGIN OPTIONAL CSQC FUNCTIONS
 void Ent_ReadEntCS()
 {
-	entity gps;
-	using_gps = true;
-
 	InterpolateOrigin_Undo();
 
+	self.classname = "entcs_receiver";
+	self.sv_entnum = ReadByte() - 1;
 	self.origin_x = ReadShort();
 	self.origin_y = ReadShort();
 	self.origin_z = ReadShort();
@@ -361,33 +354,10 @@
 	self.origin_z = self.angles_x = self.angles_z = 0;
 
 	InterpolateOrigin_Note();
-
-	for(gps = gps_start; gps; gps = gps.chain)
-	{
-		if(gps == self)
-			break;
-	}
-	if(!gps)
-	{
-		self.chain = gps_start;
-		gps_start = self;
-	}
 }
 
-void Ent_RemoveONS()
+void Ent_RemoveEntCS()
 {
-	if(gps_start == self)
-		gps_start = self.chain;
-	else
-	{
-		local entity ent;
-		ent = gps_start;
-			
-		while(ent.chain != self && ent.chain != world)
-			ent = ent.chain;
-		if(ent.chain == self)
-			ent.chain = self.chain;
-	}
 }
 
 void Ent_Remove();
@@ -494,7 +464,7 @@
 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
 void(float bIsNewEntity) CSQC_Ent_Update =
 {
-	float msg, t;
+	float t;
 	t = ReadByte();
 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
 	if(self.enttype)
@@ -506,20 +476,7 @@
 #endif
 	self.enttype = t;
 	if(self.enttype == ENT_CLIENT_ENTCS)
-	{
-		self.sv_entnum = ReadByte()-1;
-
-		for(msg = ReadByte(); msg != ENTCS_MSG_END; msg = ReadByte())
-		{
-			switch(msg)
-			{
-			case ENTCS_MSG_ONS_GPS: Ent_ReadEntCS(); break;
-			case ENTCS_MSG_ONS_REMOVE: Ent_RemoveONS(); break;
-			default:
-				error("unknown ENTCS_MSG type\n");
-			}
-		}
-	}
+		Ent_ReadEntCS();
 	else if(self.enttype == ENT_CLIENT_SCORES)
 		Ent_ReadPlayerScore();
 	else if(self.enttype == ENT_CLIENT_TEAMSCORES)
@@ -545,21 +502,7 @@
 {
 	if(self.enttype == ENT_CLIENT_ENTCS)
 	{
-		if(using_gps) //gametype == GAME_ONSLAUGHT)
-		{
-			if(gps_start == self)
-				gps_start = self.chain;
-			else
-			{
-				local entity ent;
-				ent = gps_start;
-			
-				while(ent.chain != self && ent.chain != world)
-					ent = ent.chain;
-				if(ent.chain == self)
-					ent.chain = self.chain;
-			}
-		}
+		Ent_RemoveEntCS();
 	} else if(self.enttype == ENT_CLIENT_SCORES)
 	{
 		if(self.owner)
@@ -605,9 +548,14 @@
 	minimapname = strzone(strcat("gfx/", mi_shortname, "_mini.tga"));
 	shortmapname = mi_shortname;
 
+	if(precache_pic(minimapname) == "")
+	{
+		strunzone(minimapname);
+		minimapname = ""; // FAIL
+	}
+
 	if(gametype == GAME_ONSLAUGHT) {
 		print(strcat("Using ", minimapname, " as minimap.\n"));
-		precache_pic(minimapname);
 		precache_pic("gfx/ons-cp-neutral.tga");
 		precache_pic("gfx/ons-cp-red.tga");
 		precache_pic("gfx/ons-cp-blue.tga");

Modified: branches/nexuiz-2.0/data/qcsrc/client/View.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/View.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/View.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -189,6 +189,7 @@
 	entity e;
 	float fov;
 	dprint_load();
+	WaypointSprite_Load();
 
 	// Render the Scene
 	view_origin = pmove_org + '0 0 1' * getstati(STAT_VIEWHEIGHT);
@@ -272,8 +273,7 @@
 	R_SetView(VF_DRAWCROSSHAIR, !scoreboard_active);
 	
 	// Draw the Engine Status Bar (the default Quake HUD)
-	draw_enginesbar = !cvar("sbar_usecsqc");
-	R_SetView(VF_DRAWENGINESBAR, draw_enginesbar);
+	R_SetView(VF_DRAWENGINESBAR, 0);
 
 	// Set the console size vars
 	vid_conwidth = cvar("vid_conwidth");
@@ -299,6 +299,11 @@
 	self = e;
 	R_RenderScene();
 
+	// now switch to 2D drawing mode by calling a 2D drawing function
+	// then polygon drawing will draw as 2D stuff, and NOT get queued until the
+	// next R_RenderScene call
+	drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
+
 	// Draw the mouse cursor
 	// NOTE: drawpic must happen after R_RenderScene for some reason
 	//drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);
@@ -314,19 +319,15 @@
 	{
 		ctf_view();
 	} else */
-	if(!draw_enginesbar)
-	{
-		if(cvar("r_letterbox") == 0)
-		if(cvar("viewsize") < 120)
-			CSQC_common_hud();
-	}
 
+	// draw 2D entities
 	e = self;
 	for(self = world; (self = nextent(self)); )
 		if(self.draw2d)
 			self.draw2d();
 	self = e;
 	
+	// draw radar
 	if(gametype == GAME_ONSLAUGHT)
 	{
 		if(cvar("cl_teamradar") >= 2)
@@ -347,6 +348,11 @@
 			if(!scoreboard_active)
 				teamradar_view();
 	}
+
+	// draw sbar
+	if(cvar("r_letterbox") == 0)
+	if(cvar("viewsize") < 120)
+		CSQC_common_hud();
 }
 
 void Sbar_Draw();

Modified: branches/nexuiz-2.0/data/qcsrc/client/csqc_constants.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/csqc_constants.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/csqc_constants.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -169,6 +169,7 @@
 const float DRAWFLAG_MODULATE = 2;
 const float DRAWFLAG_2XMODULATE = 3;
 const float DRAWFLAG_NUMFLAGS = 4;
+const float DRAWFLAG_MIPMAP = 0x100; // only for R_BeginPolygon
 
 #define        SOLID_NOT                               0               // no interaction with other objects
 #define        SOLID_TRIGGER                   1               // touch on edge, but not blocking

Modified: branches/nexuiz-2.0/data/qcsrc/client/main.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/main.qh	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/main.qh	2008-10-07 07:55:43 UTC (rev 4650)
@@ -41,9 +41,7 @@
 float drawfont;
 float postinit;
 float gametype;
-entity gps_start;
 
-float draw_enginesbar;
 //float sorted_players;
 //float sorted_teams;
 

Modified: branches/nexuiz-2.0/data/qcsrc/client/ons.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/ons.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/ons.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -51,7 +51,8 @@
 		drawplayer(coord, input_angles, '1 1 1');
 
 		local entity tm;
-		for(tm = gps_start; tm != world; tm = tm.chain)
+		for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
+		if(GetPlayerColor(tm.sv_entnum) == color)
 		{
 			//print(strcat("GPS: ", ftos(tm.sv_entnum), " - ", vtos(tm.origin), "\n"));
 			drawplayer(mapcoords(tm.origin), tm.angles, rgb);

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -1078,11 +1078,12 @@
 		}
 	}
 	timelimit = getstatf(STAT_TIMELIMIT);
-	if(timelimit)
+	if(timelimit > 0)
 	{
-		timeleft = max(0, timelimit * 60 - time);
+		timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
+		timeleft = ceil(timeleft);
 		minutes = floor(timeleft / 60);
-		seconds = floor(timeleft - minutes*60);
+		seconds = timeleft - minutes*60;
 		if(minutes >= 5)
 		{
 			Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
@@ -1362,7 +1363,7 @@
 		if(spectatee_status == -1)
 			s = strcat("^1Use ^3", getcommandkey("next weapon", "weapnext"), "^1 or ^3", getcommandkey("previous weapon", "weapprev"), "^1 to change the speed");
 		else
-			s = strcat("^1Press ^3", getcommandkey("secondary fire", "+altattack"), getcommandkey("", "weapprev"), "^1 to observe");
+			s = strcat("^1Press ^3", getcommandkey("secondary fire", "+attack2"), "^1 to observe");
 		o = Sbar_DrawNoteLine(o, s);
 
 		if(gametype == GAME_ARENA)

Modified: branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/teamradar.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -3,8 +3,18 @@
 vector teamradar_origin2d; // 2D origin
 vector teamradar_size2d; // 2D size
 float teamradar_size; // 2D scale factor
-float teamradar_scale; // window size = ...qu
+float cl_teamradar_scale; // window size = ...qu
 
+float vlen_maxnorm2d(vector v)
+{
+	return max4(v_x, v_y, -v_x, -v_y);
+}
+
+float vlen_minnorm2d(vector v)
+{
+	return min(max(v_x, -v_x), max(v_y, -v_y));
+}
+
 vector teamradar_3dcoord_to_texcoord(vector in)
 {
 	vector out;
@@ -38,14 +48,14 @@
 	if(a <= 0)
 		return;
 
-	R_BeginPolygon(minimapname, 0);
+	R_BeginPolygon("", 0);
 	R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', a);
 	R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y - teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', a);
 	R_PolygonVertex('1 0 0' * (teamradar_origin2d_x + teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', a);
 	R_PolygonVertex('1 0 0' * (teamradar_origin2d_x - teamradar_size2d_x * 0.5) + '0 1 0' * (teamradar_origin2d_y + teamradar_size2d_y * 0.5), '0 0 0', '0 0 0', a);
 	R_EndPolygon();
 
-	R_BeginPolygon(minimapname, DRAWFLAG_ADDITIVE);
+	R_BeginPolygon(minimapname, DRAWFLAG_ADDITIVE | DRAWFLAG_MIPMAP);
 	R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord0), yinvert(mi_pictexcoord0), '1 1 1', 1);
 	R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord1), yinvert(mi_pictexcoord1), '1 1 1', 1);
 	R_PolygonVertex(teamradar_texcoord_to_2dcoord(mi_pictexcoord2), yinvert(mi_pictexcoord2), '1 1 1', 1);
@@ -103,48 +113,106 @@
 	}
 }
 
+float cl_teamradar_scale;
+float cl_teamradar_background_alpha;
+float cl_teamradar_rotation;
+vector cl_teamradar_size;
+vector cl_teamradar_position;
+float cl_teamradar_zoommode;
+
+void teamradar_loadcvars()
+{
+	cl_teamradar_scale = cvar("cl_teamradar_scale");
+	cl_teamradar_background_alpha = cvar("cl_teamradar_background_alpha");
+	cl_teamradar_rotation = cvar("cl_teamradar_rotation");
+	cl_teamradar_size = stov(cvar_string("cl_teamradar_size"));
+	cl_teamradar_position = stov(cvar_string("cl_teamradar_position"));
+	cl_teamradar_zoommode = cvar("cl_teamradar_zoommode");
+
+	// others default to 0
+	if(!cl_teamradar_scale) cl_teamradar_scale = 4096;
+	if(!cl_teamradar_background_alpha) cl_teamradar_background_alpha = 0.75;
+	if(!cl_teamradar_size_x) cl_teamradar_size_x = 128;
+	if(!cl_teamradar_size_y) cl_teamradar_size_y = cl_teamradar_size_x;
+
+	cl_teamradar_size_z = 0;
+	cl_teamradar_position_z = 0;
+}
+
 void() teamradar_view =
 {
-	local float color;
+	local float color, color2;
 	local vector rgb;
 	local entity tm;
 	float scale2d, normalsize, bigsize;
-	float a, f;
+	float f;
 
-	color = GetPlayerColor(player_localentnum-1);
-	rgb = GetTeamRGB(color);
+	if(minimapname == "")
+		return;
 
-	scale2d = max(
-		mi_picmax_x - mi_picmin_x,
-		mi_picmax_y - mi_picmin_y
-	);
+	teamradar_loadcvars();
 
-	f = current_zoomfraction;
-	teamradar_scale = cvar("cl_teamradar_scale");
-	a = cvar("cl_teamradar_background_alpha");
-	teamradar_angle = cvar("cl_teamradar_rotation") * 90;
+	switch(cl_teamradar_zoommode)
+	{
+		default:
+		case 0:
+			f = current_zoomfraction;
+			break;
+		case 1:
+			f = 1 - current_zoomfraction;
+			break;
+		case 2:
+			f = 0;
+			break;
+		case 3:
+			f = 1;
+			break;
+	}
 
-	// fix undefined cvars first
-	if(!teamradar_scale)
-		teamradar_scale = 4096;
-	if(!a)
-		a = 0.75;
+	switch(cl_teamradar_rotation)
+	{
+		case 0:
+			teamradar_angle = input_angles_y - 90;
+			break;
+		default:
+			teamradar_angle = 90 * cl_teamradar_rotation;
+			break;
+	}
 
-	if(teamradar_scale < 0)
+	scale2d = vlen_maxnorm2d(mi_picmax - mi_picmin);
+	teamradar_size2d = cl_teamradar_size;
+	teamradar_origin2d =
+		  '1 0 0' * (0.5 * teamradar_size2d_x + cl_teamradar_position_x * (vid_conwidth - teamradar_size2d_x))
+		+ '0 1 0' * (0.5 * teamradar_size2d_y + cl_teamradar_position_y * (vid_conheight - teamradar_size2d_y));
+
+	// pixels per world qu to match the teamradar_size2d_x range in the longest dimension
+	if(cl_teamradar_rotation == 0)
 	{
-		f = 1 - f;
-		teamradar_scale = -teamradar_scale;
+		// max-min distance must fit the radar in any rotation
+		bigsize = vlen_minnorm2d(teamradar_size2d) * scale2d / (1.05 * vlen(mi_max - mi_min));
 	}
+	else
+	{
+		vector c0, c1, c2, c3, span;
+		c0 = rotate(mi_min, teamradar_angle * DEG2RAD);
+		c1 = rotate(mi_max, teamradar_angle * DEG2RAD);
+		c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, teamradar_angle * DEG2RAD);
+		c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, teamradar_angle * DEG2RAD);
+		span = '0 0 0';
+		span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x);
+		span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y);
 
-	if(!teamradar_angle)
-		teamradar_angle = input_angles_y - 90;
-	teamradar_origin2d = '64 64 0';
-	teamradar_size2d = '128 128 0';
+		// max-min distance must fit the radar in x=x, y=y
+		bigsize = min(
+			teamradar_size2d_x * scale2d / (1.05 * span_x),
+			teamradar_size2d_y * scale2d / (1.05 * span_y)
+		);
+	}
 
-	normalsize = teamradar_size2d_x * scale2d / teamradar_scale;
-	bigsize = teamradar_size2d_x * scale2d / vlen(mi_min - mi_max);
+	normalsize = vlen_maxnorm2d(teamradar_size2d) * scale2d / cl_teamradar_scale;
 	if(bigsize > normalsize)
 		normalsize = bigsize;
+
 	teamradar_size =
 		  f * bigsize
 		+ (1 - f) * normalsize;
@@ -152,6 +220,9 @@
 		  f * (mi_min + mi_max) * 0.5
 		+ (1 - f) * pmove_org);
 
+	color = GetPlayerColor(player_localentnum-1);
+	rgb = GetTeamRGB(color);
+
 	drawsetcliparea(
 		teamradar_origin2d_x - teamradar_size2d_x * 0.5,
 		teamradar_origin2d_y - teamradar_size2d_y * 0.5,
@@ -159,11 +230,15 @@
 		teamradar_size2d_y
 	);
 
-	draw_teamradar_background(a);
+	draw_teamradar_background(cl_teamradar_background_alpha);
 	for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
 		draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm.teamradar_time, tm.teamradar_color, tm.alpha);
-	for(tm = gps_start; tm != world; tm = tm.chain)
-		draw_teamradar_player(tm.origin, tm.angles, rgb);
+	for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
+	{
+		color2 = GetPlayerColor(tm.sv_entnum);
+		//if(color == COLOR_SPECTATOR || color == color2)
+			draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+	}
 	draw_teamradar_player(pmove_org, input_angles, '1 1 1');
 
 	drawresetcliparea();

Modified: branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/client/waypointsprites.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -17,6 +17,7 @@
 float waypointsprite_minalpha;
 float waypointsprite_distancealphaexponent;
 float waypointsprite_timealphaexponent;
+float waypointsprite_scale;
 
 .float rule;
 .string netname; // primary picture
@@ -44,6 +45,7 @@
 	v4 = hotspot                  + '0 1 0' * sz_y;
 
 	// rotate them, and make them absolute
+	rot = -rot; // rotate by the opposite angle, as our coordinate system is reversed
 	v1 = rotate(v1, rot) + org;
 	v2 = rotate(v2, rot) + org;
 	v3 = rotate(v3, rot) + org;
@@ -88,7 +90,15 @@
 	switch(self.rule)
 	{
 		case SPRITERULE_DEFAULT:
-			spriteimage = self.netname;
+			if(self.team)
+			{
+				if(self.team == t)
+					spriteimage = self.netname;
+				else
+					spriteimage = "";
+			}
+			else
+				spriteimage = self.netname;
 			break;
 		case SPRITERULE_TEAMPLAY:
 			if(self.team == t)
@@ -140,13 +150,13 @@
 			{
 				// RIGHT edge
 				d = d * (0.5 / f1);
-				rot = 1;
+				rot = 3;
 			}
 			else
 			{
 				// LEFT edge
 				d = d * (-0.5 / f1);
-				rot = 3;
+				rot = 1;
 			}
 		}
 		else
@@ -169,7 +179,9 @@
 	}
 	o_z = 0;
 
-	drawrotpic(o, rot * 90 * DEG2RAD, strcat("models/sprites/", spriteimage), SPRITE_SIZE, SPRITE_HOTSPOT, '1 1 1', a, 0);
+	float vidscale;
+	vidscale = max(vid_conwidth / vid_width, vid_conheight / vid_height);
+	drawrotpic(o, rot * 90 * DEG2RAD, strcat("models/sprites/", spriteimage), SPRITE_SIZE * waypointsprite_scale * vidscale, SPRITE_HOTSPOT * waypointsprite_scale * vidscale, '1 1 1', a, 0);
 }
 
 void Ent_WaypointSprite()
@@ -245,7 +257,7 @@
 		strunzone(self.netname3);
 }
 
-void WaypointSprite_Init()
+void WaypointSprite_Load()
 {
 	waypointsprite_fadedistance = vlen(world.maxs - world.mins);
 	waypointsprite_normdistance = cvar("g_waypointsprite_normdistance");
@@ -253,4 +265,7 @@
 	waypointsprite_minalpha = cvar("g_waypointsprite_minalpha");
 	waypointsprite_distancealphaexponent = cvar("g_waypointsprite_distancealphaexponent");
 	waypointsprite_timealphaexponent = cvar("g_waypointsprite_timealphaexponent");
+	waypointsprite_scale = cvar("g_waypointsprite_scale");
+	if(!waypointsprite_scale)
+		waypointsprite_scale = 1.0;
 }

Modified: branches/nexuiz-2.0/data/qcsrc/common/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2008-10-07 07:55:43 UTC (rev 4650)
@@ -227,6 +227,7 @@
 const float STAT_SYS_TICRATE = 34;
 const float STAT_WEAPONS = 35;
 const float STAT_SWITCHWEAPON = 36;
+const float STAT_GAMESTARTTIME = 37;
 const float CTF_STATE_ATTACK = 1;
 const float CTF_STATE_DEFEND = 2;
 const float CTF_STATE_COMMANDER = 3;

Modified: branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -625,12 +625,12 @@
 			t = car(s); s = cdr(s); d = stof(t);
 			t = car(s); s = cdr(s); e = stof(t);
 			if(s == "")
-				print("Map ", pFilename, " contains an incorrect size line, syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+				print("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
 			else
 			{
 				t = car(s); s = cdr(s); f = stof(t);
 				if(s != "")
-					print("Map ", pFilename, " contains an incorrect size line, syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+					print("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
 				else
 				{
 					if(a >= d || b >= e || c >= f)

Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -805,3 +805,17 @@
 	cvar_set("settemp_list", "0");
 }
 #endif
+
+float almost_equals(float a, float b)
+{
+	float eps;
+	eps = (max(a, -a) + max(b, -b)) * 0.001;
+	if(a - b < eps && b - a < eps)
+		return TRUE;
+	return FALSE;
+}
+
+float almost_in_bounds(float a, float b, float c)
+{
+	return almost_equals(b, median(a, b, c));
+}

Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qh	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qh	2008-10-07 07:55:43 UTC (rev 4650)
@@ -96,3 +96,6 @@
 #endif
 
 #define FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(x) void reference_##x() { x = x; }
+
+float almost_equals(float a, float b);
+float almost_in_bounds(float a, float b, float c);

Modified: branches/nexuiz-2.0/data/qcsrc/menu/classes.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/classes.c	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/menu/classes.c	2008-10-07 07:55:43 UTC (rev 4650)
@@ -67,3 +67,4 @@
 #include "nexuiz/credits.c"
 #include "nexuiz/dialog_multiplayer_playersetup_weapons.c"
 #include "nexuiz/weaponslist.c"
+#include "nexuiz/dialog_multiplayer_playersetup_radar.c"

Modified: branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/menu/item/slider.c	2008-10-07 07:55:43 UTC (rev 4650)
@@ -56,9 +56,9 @@
 }
 string valueToTextSlider(entity me, float val)
 {
-	if(val < me.valueMin) return "";
-	if(val > me.valueMax) return "";
-	return ftos_decimals(val * me.valueDisplayMultiplier, me.valueDigits);
+	if(almost_in_bounds(me.valueMin, val, me.valueMax))
+		return ftos_decimals(val * me.valueDisplayMultiplier, me.valueDigits);
+	return "";
 }
 void configureSliderVisualsSlider(entity me, float sz, float theAlign, float theTextSpace, string gfx)
 {
@@ -205,7 +205,7 @@
 	if(me.disabled)
 		draw_alpha *= me.disabledAlpha;
 	draw_ButtonPicture('0 0 0', strcat(me.src, "_s"), eX * (1 - me.textSpace) + eY, me.color2, 1);
-	if(me.value == median(me.valueMin, me.value, me.valueMax))
+	if(almost_in_bounds(me.valueMin, me.value, me.valueMax))
 	{
 		controlLeft = (me.value - me.valueMin) / (me.valueMax - me.valueMin) * (1 - me.textSpace - me.controlWidth);
 		if(me.disabled)

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup.c	2008-10-07 07:55:43 UTC (rev 4650)
@@ -73,7 +73,7 @@
 		me.TD(me, 1, 2, e = makeNexuizSlider(2, 16, 0.5, "cl_zoomfactor"));
 	me.TR(me);
 		sl = makeNexuizSlider(1, 8, 0.5, "cl_zoomspeed");
-		me.TD(me, 1, 2.8, e = makeNexuizSliderCheckBox(-1, 1, sl, "Zoom speed:"));
+		me.TD(me, 1, 1, e = makeNexuizSliderCheckBox(-1, 1, sl, "Zoom speed:"));
 		me.TD(me, 1, 2, sl);
 	me.TR(me);
 		me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "cl_autoswitch", "Auto switch weapons on pickup"));
@@ -87,7 +87,7 @@
 	me.TR(me);
 	me.TR(me);
 		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Crosshair:"));
-		n = 11;
+		n = 12;
 		for(i = 1; i <= n; ++i)
 			me.TDNoMargin(me, 1, 2 / n, e = makeNexuizCrosshairButton(3, i), '0 0 0');
 	me.TR(me);
@@ -118,25 +118,13 @@
 		me.TD(me, 1, 2.8, e = makeNexuizCheckBox(0, "sbar_hudselector", "Use alternate HUD layout"));
 			setDependent(e, "viewsize", 0, 110);
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Show Binds:"));
-		me.TD(me, 1, 2, e = makeNexuizTextSlider("sbar_showbinds"));
-			e.addValue(e, "None", "0");
-			e.addValue(e, "Short", "1");
-			e.addValue(e, "Long", "2");
-			e.configureNexuizTextSliderValues(e);
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Show names:"));
-		me.TD(me, 1, 2, e = makeNexuizTextSlider("cl_shownames"));
-			e.addValue(e, "Never", "0");
-			e.addValue(e, "Team games", "1");
-			e.addValue(e, "Always", "2");
-			e.configureNexuizTextSliderValues(e);
+		me.TDempty(me, 0.5);
+		me.TD(me, 1, 2, e = makeNexuizButton("Radar & Waypoints...", '0 0 0'));
+			e.onClick = DialogOpenButton_Click;
+			e.onClickEntity = main.radarDialog;
+		me.TDempty(me, 0.5);
 	me.TR(me);
-		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Show waypoints:"));
-		me.TD(me, 1, 2, e = makeNexuizTextSlider("cl_hidewaypoints"));
-			e.addValue(e, "Players", "1");
-			e.addValue(e, "All", "0");
-			e.configureNexuizTextSliderValues(e);
 	me.TR(me);
 		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Network speed:"));
 		me.TD(me, 1, 2, e = makeNexuizTextSlider("_cl_rate"));

Copied: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_radar.c (from rev 4649, trunk/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_radar.c)
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_radar.c	                        (rev 0)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_playersetup_radar.c	2008-10-07 07:55:43 UTC (rev 4650)
@@ -0,0 +1,111 @@
+#ifdef INTERFACE
+CLASS(NexuizRadarDialog) EXTENDS(NexuizDialog)
+	METHOD(NexuizRadarDialog, toString, string(entity))
+	METHOD(NexuizRadarDialog, fill, void(entity))
+	METHOD(NexuizRadarDialog, showNotify, void(entity))
+	ATTRIB(NexuizRadarDialog, title, string, "Radar & Waypoints")
+	ATTRIB(NexuizRadarDialog, color, vector, SKINCOLOR_DIALOG_RADAR)
+	ATTRIB(NexuizRadarDialog, intendedWidth, float, 0.6)
+	ATTRIB(NexuizRadarDialog, rows, float, 17)
+	ATTRIB(NexuizRadarDialog, columns, float, 4)
+ENDCLASS(NexuizRadarDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void showNotifyNexuizRadarDialog(entity me)
+{
+        loadAllCvars(me);
+}
+string toStringNexuizRadarDialog(entity me)
+{
+	return "XXX";
+}
+void fillNexuizRadarDialog(entity me)
+{
+	entity e, sl;
+	me.TR(me);
+		me.TD(me, 1, 4, makeNexuizTextLabel(0, "Radar settings:"));
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 0.8, e = makeNexuizTextLabel(0, "Position:"));
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_position", "0 0", "Top left"));
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_position", "0.5 0", "Top middle"));
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_position", "1 0", "Top right"));
+	me.TR(me);
+		me.TDempty(me, 1);
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_position", "0.5 0", "Middle left"));
+		me.TDempty(me, 1);
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_position", "0.5 1", "Middle right"));
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 0.8, e = makeNexuizTextLabel(0, "Size:"));
+		me.TD(me, 1, 3, e = makeNexuizTextSlider("cl_teamradar_size"));
+			e.addValue(e, "96x96", "96 96");
+			e.addValue(e, "128x96", "128 96");
+			e.addValue(e, "128x128", "128 128");
+			e.addValue(e, "192x144", "192 144");
+			e.addValue(e, "192x192", "192 192");
+			e.addValue(e, "256x192", "256 192");
+			e.addValue(e, "256x256", "256 256");
+			e.configureNexuizTextSliderValues(e);
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 0.8, e = makeNexuizTextLabel(0, "Zoom:"));
+		me.TD(me, 1, 1.5, e = makeNexuizRadioButton(1, "cl_teamradar_zoommode", "0", "Zoom key zooms out"));
+		me.TD(me, 1, 1.5, e = makeNexuizRadioButton(1, "cl_teamradar_zoommode", "1", "Zoom key zooms in"));
+	me.TR(me);
+		me.TDempty(me, 1);
+		me.TD(me, 1, 1.5, e = makeNexuizRadioButton(1, "cl_teamradar_zoommode", "2", "Always zoomed in"));
+		me.TD(me, 1, 1.5, e = makeNexuizRadioButton(1, "cl_teamradar_zoommode", "3", "Always zoomed out"));
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 0.8, e = makeNexuizTextLabel(0, "Zoomed scale:"));
+			setDependent(e, "cl_teamradar_zoommode", 0, 2);
+		me.TD(me, 1, 3, e = makeNexuizTextSlider("cl_teamradar_scale"));
+			e.addValue(e, "1:2048", "2048");
+			e.addValue(e, "1:3072", "3072");
+			e.addValue(e, "1:4096", "4096");
+			e.addValue(e, "1:6144", "6144");
+			e.addValue(e, "1:8192", "8192");
+			e.configureNexuizTextSliderValues(e);
+			setDependent(e, "cl_teamradar_zoommode", 0, 2);
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 1.8, e = makeNexuizTextLabel(0, "Rotation (UP direction):"));
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_rotation", "4", "North"));
+		me.TDempty(me, 1);
+	me.TR(me);
+		me.TDempty(me, 1);
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_rotation", "1", "West"));
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_rotation", "0", "Forward"));
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_rotation", "3", "East"));
+	me.TR(me);
+		me.TDempty(me, 2);
+		me.TD(me, 1, 1, e = makeNexuizRadioButton(1, "cl_teamradar_rotation", "2", "South"));
+		me.TDempty(me, 1);
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		sl = makeNexuizSlider(0.1, 1.0, 0.01, "cl_teamradar_background_alpha");
+		me.TD(me, 1, 0.8, e = makeNexuizSliderCheckBox(-1, 1, sl, "Background:"));
+		me.TD(me, 1, 3, sl);
+	me.TR(me);
+	me.TR(me);
+		me.TD(me, 1, 4, makeNexuizTextLabel(0, "Waypoint settings:"));
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 0.8, e = makeNexuizTextLabel(0, "Show names:"));
+		me.TD(me, 1, 3, e = makeNexuizTextSlider("cl_shownames"));
+			e.addValue(e, "Never", "0");
+			e.addValue(e, "Team games", "1");
+			e.addValue(e, "Always", "2");
+			e.configureNexuizTextSliderValues(e);
+	me.TR(me);
+		me.TDempty(me, 0.2);
+		me.TD(me, 1, 3.8, e = makeNexuizCheckBox(1, "cl_hidewaypoints", "Show base waypoints"));
+	me.gotoRC(me, me.rows - 1, 0);
+		me.TD(me, 1, me.columns, e = makeNexuizButton("OK", '0 0 0'));
+			e.onClick = Dialog_Close;
+			e.onClickEntity = me;
+}
+
+#endif

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_input.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_input.c	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_input.c	2008-10-07 07:55:43 UTC (rev 4650)
@@ -62,6 +62,13 @@
 	me.TR(me);
 		me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "con_closeontoggleconsole", "\"enter console\" also closes"));
 	me.TR(me);
+		me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Show binds:"));
+		me.TD(me, 1, 2, e = makeNexuizTextSlider("sbar_showbinds"));
+			e.addValue(e, "None", "0");
+			e.addValue(e, "Short", "1");
+			e.addValue(e, "Long", "2");
+			e.configureNexuizTextSliderValues(e);
+	me.TR(me);
 		if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
 			me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "vid_dgamouse", "Turn off OS mouse acceleration"));
 		else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE)

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/mainwindow.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/mainwindow.c	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/mainwindow.c	2008-10-07 07:55:43 UTC (rev 4650)
@@ -6,6 +6,7 @@
 	ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
 	ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
 	ATTRIB(MainWindow, winnerDialog, entity, NULL)
+	ATTRIB(MainWindow, radarDialog, entity, NULL)
 	ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
 ENDCLASS(MainWindow)
 #endif
@@ -48,6 +49,10 @@
 	i.configureDialog(i);
 	me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+	me.radarDialog = i = spawnNexuizRadarDialog();
+	i.configureDialog(i);
+	me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
 	n = spawnNexuizNexposee();
 	/*
 		if(checkextension("DP_GECKO_SUPPORT"))

Modified: branches/nexuiz-2.0/data/qcsrc/menu/skin-customizables.inc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/skin-customizables.inc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/menu/skin-customizables.inc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -48,6 +48,7 @@
 	SKINVECTOR(COLOR_DIALOG_SINGLEPLAYER, '1 1 0.7');
 	SKINVECTOR(COLOR_DIALOG_CREDITS, '0.7 0.7 1');
 	SKINVECTOR(COLOR_DIALOG_WEAPONS, '1 0.7 0.7');
+	SKINVECTOR(COLOR_DIALOG_RADAR, '0.7 0.7 1');
 
 	// nexposee positions of windows (they are the scale transformation
 	// centers, NOT the actual positions of the windows!)

Modified: branches/nexuiz-2.0/data/qcsrc/server/arena.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/arena.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/arena.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -134,7 +134,7 @@
 				restart_mapalreadyrestarted to 1 after the countdown ended or when
 				sv_ready_restart_after_countdown is not used and countdown is still running
 				*/
-				if (restart_mapalreadyrestarted || (time < restart_countdown))
+				if (restart_mapalreadyrestarted || (time < game_starttime))
 				{
 					//NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
 					if (self.classname == "player") {
@@ -154,7 +154,7 @@
 	}
 
 	if(g_keyhunt)
-		kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+RESTART_COUNTDOWN, "", kh_StartRound);
+		kh_Controller_SetThink(cvar("g_balance_keyhunt_delay_round")+(game_starttime - time), "", kh_StartRound);
 
 	if(g_arena)
 	if(champion)
@@ -225,7 +225,7 @@
 	float f;
 	string msg;
 
-	if(!g_arena || !arena_roundbased || (time < restart_countdown))
+	if(!g_arena || !arena_roundbased || (time < game_starttime))
 		return;
 
 	f = rint(warmup - time);

Modified: branches/nexuiz-2.0/data/qcsrc/server/bots.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/bots.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/bots.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -1815,7 +1815,7 @@
 	//self.bot_painintensity = self.bot_painintensity + self.bot_oldhealth - self.health;
 	//self.bot_painintensity = bound(0, self.bot_painintensity, 100);
 
-	if(time < restart_countdown || ((cvar("g_campaign") && !campaign_bots_may_start)))
+	if(time < game_starttime || ((cvar("g_campaign") && !campaign_bots_may_start)))
 	{
 		self.nextthink = time + 0.5;
 		return;

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -671,11 +671,11 @@
 		self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
 		self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
 		//extend the pause of rotting if client was reset at the beginning of the countdown
-		if(!cvar("sv_ready_restart_after_countdown") && time < restart_countdown) {
-			self.spawnshieldtime += RESTART_COUNTDOWN;
-			self.pauserotarmor_finished += RESTART_COUNTDOWN;
-			self.pauserothealth_finished += RESTART_COUNTDOWN;
-			self.pauseregen_finished += RESTART_COUNTDOWN;
+		if(!cvar("sv_ready_restart_after_countdown") && time < game_starttime) { // TODO why is this cvar NOTted?
+			self.spawnshieldtime += game_starttime - time;
+			self.pauserotarmor_finished += game_starttime - time;
+			self.pauserothealth_finished += game_starttime - time;
+			self.pauseregen_finished += game_starttime - time;
 		}
 		self.damageforcescale = 2;
 		self.death_time = 0;
@@ -1209,7 +1209,7 @@
 		ctf_clientconnect();
 	}*/
 
-	if(entcs_start)
+	if(teams_matter)
 		attach_entcs();
 
 	bot_relinkplayerlist();
@@ -1279,7 +1279,7 @@
 
 	bot_clientdisconnect();
 
-	if(entcs_start)
+	if(teams_matter)
 		detach_entcs();
 	
 	if(cvar("sv_eventlog"))
@@ -1605,7 +1605,7 @@
 	if (g_midair)
 		self.spawnshieldtime = max(self.spawnshieldtime, time + cvar("g_midair_shieldtime"));
 
-	if (time > restart_countdown)
+	if (time >= game_starttime)
 	if (time < self.spawnshieldtime)
 		self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
 }
@@ -1736,6 +1736,8 @@
 	self.impulse = 0;
 	self.items = spectatee.items;
 	self.weapons = spectatee.weapons;
+	self.switchweapon = spectatee.switchweapon;
+	self.weapon = spectatee.weapon;
 	self.punchangle = spectatee.punchangle;
 	self.view_ofs = spectatee.view_ofs;
 	self.v_angle = spectatee.v_angle;
@@ -1997,6 +1999,8 @@
 void PlayerPreThink (void)
 {
 	self.stat_sys_ticrate = cvar("sys_ticrate");
+	self.stat_game_starttime = game_starttime;
+
 	if(blockSpectators)
 		checkSpectatorBlock();
 	
@@ -2140,7 +2144,7 @@
 			dist_z = 0;
 			self.lms_traveled_distance += fabs(vlen(dist));
 
-			if((cvar("g_campaign") && !campaign_bots_may_start) || (time < restart_countdown))
+			if((cvar("g_campaign") && !campaign_bots_may_start) || (time < game_starttime))
 			{
 				self.lms_nextcheck = time + cvar("g_lms_campcheck_interval")*2;
 				self.lms_traveled_distance = 0;
@@ -2294,16 +2298,16 @@
 		//if (TetrisPostFrame()) return;
 
 		// restart countdown
-		if (restart_countdown) {
-			if(time < restart_countdown) {
+			if(time < game_starttime) {
 				if (!cvar("sv_ready_restart_after_countdown"))
 				{
 					if(self.movement != '0 0 0' && g_race && !g_race_qualifying)
 					{
-						if(time < restart_countdown - 2)
+						if(time < game_starttime - 2)
 						{
 							if(!self.race_penalty_nagged)
 							{
+								// TODO better notification for this!
 								centerprint_atprio(self, CENTERPRIO_IDLEKICK, "^1DO NOT MOVE DURING THE COUNTDOWN.");
 								self.race_penalty_nagged = 1;
 							}
@@ -2340,7 +2344,6 @@
 					self.race_penalty_nagged = 0;
 				}
 			}
-		}
 		
 	} else if (self.classname == "observer") {
 		//do nothing

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_impulse.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -74,7 +74,6 @@
  * 30 to 39: create waypoints
  * 47: clear personal waypoints
  * 48: clear team waypoints
- * 49: turn base waypoints on/off
  *
  * 99: loaded
  *
@@ -304,14 +303,6 @@
 				WaypointSprite_ClearOwned();
 				sprint(self, "all waypoints cleared\n");
 				break;
-			case 49:
-				self.cvar_cl_hidewaypoints = !(self.cvar_cl_hidewaypoints);
-				sprint(self, "fixed waypoints now ");
-				if(self.cvar_cl_hidewaypoints)
-					sprint(self, "OFF\n");
-				else
-					sprint(self, "ON\n");
-				break;
 		}
 	}
 	else if(imp >= 140 && imp <= 149 || imp == 99) // 10 cheats ought to be enough for anyone

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -244,7 +244,7 @@
 // Bringed back weapon frame
 void W_WeaponFrame()
 {
-	if((arena_roundbased && time < warmup) || ((time < restart_countdown) && !cvar("sv_ready_restart_after_countdown")))
+	if((arena_roundbased && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
 		return;
 
 	if (!self.weaponentity || self.health < 1)

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -412,7 +412,7 @@
 	//if sv_ready_restart_after_countdown is set, don't allow the player to shoot
 	//if all players readied up and the countdown is running
 	if (cvar("sv_ready_restart_after_countdown"))
-		if(time < restart_countdown || time < self.race_penalty) {
+		if(time < game_starttime || time < self.race_penalty) {
 			return FALSE;
 		}
 	

Modified: branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -330,7 +330,7 @@
 				return sprint(self, "^1You cannot reset the game while a timeout is active!\n");
 			}
 			
-			if(!restart_countdown || cvar("sv_ready_restart_repeatable"))
+			if(game_starttime == 0 || cvar("sv_ready_restart_repeatable"))
 			{
 				self.ready = TRUE;
 				bprint(self.netname, "^2 is ready\n");
@@ -454,17 +454,8 @@
 	if(checkrules_overtimeend)
 		checkrules_overtimeend = 0;
 
-	restart_countdown = time + RESTART_COUNTDOWN;
+	game_starttime = time + RESTART_COUNTDOWN;
 	restart_mapalreadyrestarted = 0; //reset this var, needed when cvar sv_ready_restart_repeatable is in use
-	if(0 < cvar("timelimit") || inWarmupStage)
-	{
-		// remember original timelimit on first restart
-		if(!timelimit_orig)
-			timelimit_orig = cvar("timelimit");
-		//only set the new timelimit if, when loading the map, a timelimit was really set
-		if(timelimit_orig)
-			cvar_set("timelimit", ftos(timelimit_orig + ceil(restart_countdown)/60));
-	}
 
 	inWarmupStage = 0; //once the game is restarted the game is in match stage
 
@@ -598,22 +589,19 @@
 void evaluateTimeoutCall() {
 	if (inWarmupStage && !g_warmup_allow_timeout)
 		return sprint(self, "^7Error: You can not call a timeout in warmup-stage!\n");
-	if (time < restart_countdown )
+	if (time < game_starttime )
 		return sprint(self, "^7Error: You can not call a timeout while the map is being restarted!\n");
 	if (timeoutStatus != 2) {
 		//if the map uses a timelimit make sure that timeout cannot be called right before the map ends
 		if (cvar("timelimit")) {
 			//a timelimit was used
 			local float myTl;
-			if (cvar("timelimit"))
-				myTl = cvar("timelimit");
-			else
-				myTl = timelimit_orig;
+			myTl = cvar("timelimit");
 
 			local float lastPossibleTimeout;
 			lastPossibleTimeout = (myTl*60) - cvar("sv_timeout_leadtime") - 1;
 
-			if (lastPossibleTimeout < time)
+			if (lastPossibleTimeout < time - game_starttime)
 				return sprint(self, "^7Error: It is too late to call a timeout now!\n");
 		}
 	}

Modified: branches/nexuiz-2.0/data/qcsrc/server/defs.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2008-10-07 07:55:43 UTC (rev 4650)
@@ -277,14 +277,12 @@
 
 .float ready;
 #define RESTART_COUNTDOWN 10
-float restart_countdown; //point in time when the countdown is over
 float restart_mapalreadyrestarted; //bool, indicates whether reset_map() was already executed
 entity restartAnnouncer; //a temporary entity which will play the countdown sounds 3, 2, 1 for all clients, will also reset the map after the countdown
 void restartAnnouncer_Think();
 float blockSpectators; //if set, new or existing spectators or observers will be removed unless they become a player within g_maxplayers_spectator_blocktime seconds
 .float spectatortime; //point in time since the client is spectating or observing
 void checkSpectatorBlock();
-float timelimit_orig;
 
 .float winning;
 .float jointime;
@@ -337,7 +335,6 @@
 .float cvar_cl_nogibs;
 .float cvar_scr_centertime;
 .float cvar_cl_shownames;
-.float cvar_cl_hidewaypoints;
 .string cvar_g_nexuizversion;
 .string cvar_cl_weaponpriority;
 .string cvar_cl_weaponpriorities[10];
@@ -492,3 +489,8 @@
 .string fog;
 
 string cvar_changes;
+
+float game_starttime; //point in time when the countdown is over
+.float stat_game_starttime;
+
+void W_Porto_Remove (entity p);

Modified: branches/nexuiz-2.0/data/qcsrc/server/domination.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/domination.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/domination.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -121,7 +121,7 @@
 
 	// give points
 
-	if (gameover || self.delay > time || time < restart_countdown)	// game has ended, don't keep giving points
+	if (gameover || self.delay > time || time < game_starttime)	// game has ended, don't keep giving points
 		return;
 
 	waittime = cvar("g_domination_point_rate");

Modified: branches/nexuiz-2.0/data/qcsrc/server/ent_cs.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/ent_cs.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/ent_cs.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -13,100 +13,80 @@
 // it did when I added this) But you have to use .Version
 // Capital V
 
-entity entcs_start;
+.entity entcs;
 
 void entcs_init()
 {
 	print("Initializing ClientSide information entities\n");
-	entcs_start = spawn();
-	entcs_start.solid = SOLID_NOT;
-	entcs_start.chain = world;
 };
 
-entity get_entcs_ent()
+float entcs_customize()
 {
-	entity entcs;
-	entcs = spawn();
-	entcs.chain = entcs_start.chain;
-	entcs_start.chain = entcs;
-	return entcs;
-};
-
-void entcs_ons(entity to)
-{
-	if(to == self.owner || self.team != to.team || self.owner.classname != "player" || to.classname != "player" || self.owner.deadflag != DEAD_NO)
-	{
-		WriteByte(MSG_ENTITY, ENTCS_MSG_ONS_REMOVE); // looks like a waste to me
-		return;
-	}
-	WriteByte(MSG_ENTITY, ENTCS_MSG_ONS_GPS);
-	WriteShort(MSG_ENTITY, self.owner.origin_x);
-	WriteShort(MSG_ENTITY, self.owner.origin_y);
-	WriteShort(MSG_ENTITY, self.owner.origin_z);
-	WriteByte(MSG_ENTITY, self.owner.angles_y * 256.0 / 360);
+	entity o;
+	o = self.owner;
+	if(o.deadflag != DEAD_NO)
+		return FALSE;
+	if(o.classname != "player")
+		return FALSE;
+	if(other == o)
+		return FALSE;
+	if(other.classname == "player")
+		if(o.team != other.team)
+			return FALSE;
+	return TRUE;
 }
 
-void entcs_common_self()
-{
-}
-
 float entcs_send(entity to)
 {
+	entity o;
+	o = self.owner;
 	WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
-	WriteByte(MSG_ENTITY, self.health); // serves as entitynumber
-
-	if(to == self.owner)
-	{
-		entcs_common_self();
-	}
-
-	if(teams_matter)
-		entcs_ons(to);
-
-	WriteByte(MSG_ENTITY, ENTCS_MSG_END);
+	WriteByte(MSG_ENTITY, num_for_edict(o));
+	WriteShort(MSG_ENTITY, o.origin_x);
+	WriteShort(MSG_ENTITY, o.origin_y);
+	WriteShort(MSG_ENTITY, o.origin_z);
+	WriteByte(MSG_ENTITY, o.angles_y * 256.0 / 360);
 	return TRUE;
 };
 
 void entcs_think()
 {
-	self.team = self.owner.team;
-	self.Version++;
-	setorigin(self, self.owner.origin);
 	self.nextthink = time;
+
+	entity o;
+	o = self.owner;
+
+	if(o.origin != self.origin || o.angles != self.angles)
+	{
+		self.origin = o.origin;
+		self.angles = o.angles;
+		self.SendFlags |= 1;
+	}
 };
 
 entity attach_entcs()
 {
-	local float num;
 	local entity ent;
 
-	num = num_for_edict(self);
-	ent = get_entcs_ent();
-
-	ent.classname = "entcs_sender";
-	ent.health = num;
-	setorigin(ent, self.origin);
+	ent = spawn();
+	ent.classname = "entcs_sender_v2";
 	ent.owner = self;
 	ent.think = entcs_think;
 	ent.nextthink = time;
 	ent.effects = EF_NODEPTHTEST | EF_LOWPRECISION;
 	ent.model = "entcs_sender";
 	ent.modelindex = 1;
-	setsize(ent, '0 0 0', '0 0 0');
 
 	ent.SendEntity = entcs_send;
+	ent.customizeentityforclient = entcs_customize;
+
+	self.entcs = ent;
+
 	return ent;
 };
 
 void detach_entcs()
 {
-	local float num;
-	local entity ent;
-	num = num_for_edict(self);
-	for(ent = entcs_start; ent.chain.owner != self && ent.chain != world; ent = ent.chain);
-	if(ent.chain != world && ent.chain.owner == self)
-	{
-		remove(ent.chain);
-		ent.chain = ent.chain.chain;
-	}
+	remove(self.entcs);
+	self.entcs = world;
 };

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -68,6 +68,11 @@
 }
 float LostMovetypeFollow(entity ent)
 {
+/*
+	if(ent.movetype != MOVETYPE_FOLLOW)
+		if(ent.aiment)
+			error("???");
+*/
 	if(ent.aiment)
 	{
 		if(ent.aiment.classname != ent.aiment_classname)
@@ -274,11 +279,12 @@
 		}
 	}
 
+	GrapplingHook_Stop();
+
 	if(other)
 		if(other.movetype != MOVETYPE_NONE)
 			SetMovetypeFollow(self, other);
 
-	GrapplingHook_Stop();
 	//self.owner.disableclientprediction = TRUE;
 }
 
@@ -304,7 +310,7 @@
 	local entity missile;
 	local vector org;
 
-	if((arena_roundbased && time < warmup) || (time < restart_countdown))
+	if((arena_roundbased && time < warmup) || (time < game_starttime))
 		return;
 
 	makevectors(self.v_angle);

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -354,12 +354,6 @@
 	MapInfo_Enumerate();
 	MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 1);
 
-	//if tourney is used map starts in warmup mode. if this mode shall stay unlimited, reset timelimit, but save the original one
-	if(inWarmupStage) {
-		timelimit_orig = cvar("timelimit");
-		cvar_set("timelimit", "0");
-	}
-
 	if(whichpack(strcat("maps/", mapname, ".cfg")) != "")
 	{
 		fd = fopen(strcat("maps/", mapname, ".cfg"), FILE_READ);
@@ -398,6 +392,7 @@
 	addstat(STAT_SYS_TICRATE, AS_FLOAT, stat_sys_ticrate);
 	addstat(STAT_WEAPONS, AS_INT, weapons);
 	addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon);
+	addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime);
 	Nagger_Init();
 
 	next_pingtime = time + 5;
@@ -1286,7 +1281,7 @@
 				local entity oldself;
 				oldself = self;
 				self = ent;
-				cvar_set("timelimit", ftos((2*time)/60));
+				cvar_set("timelimit", ftos((2*time)/60)); // FIXME use game_starttime here
 				assault_new_round();
 				self = oldself;
 			}
@@ -1610,9 +1605,15 @@
 	timelimit = cvar("timelimit") * 60;
 	fraglimit = cvar("fraglimit");
 
-	if(inWarmupStage)
+	if(inWarmupStage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts
+	{
+		timelimit = 0; // timelimit is not made for warmup
 		fraglimit = 0; // no fraglimit for now
+	}
 
+	if(timelimit > 0)
+		timelimit += game_starttime;
+
 	if(checkrules_overtimeend)
 	{
 		if(!checkrules_overtimewarning)

Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -526,7 +526,6 @@
 	if(f > 0)
 		s = strcat1(argv(f));
 	GetCvars_handleFloat(s, f, autoswitch, "cl_autoswitch");
-	GetCvars_handleFloat(s, f, cvar_cl_hidewaypoints, "cl_hidewaypoints");
 	GetCvars_handleFloat(s, f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction");
 	GetCvars_handleFloat(s, f, cvar_cl_nogibs, "cl_nogibs");
 	GetCvars_handleFloat(s, f, cvar_scr_centertime, "scr_centertime");

Modified: branches/nexuiz-2.0/data/qcsrc/server/portals.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/portals.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/portals.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -5,10 +5,7 @@
 .vector portal_safe_origin;
 .float portal_wants_to_vanish;
 .float portal_activatetime;
-.float portal_id;
 
-.entity portal_in, portal_out;
-
 vector Portal_Transform_Apply(vector transform, vector v)
 {
 	fixedmakevectors(transform);
@@ -127,7 +124,11 @@
 	safe = trace_endpos + normalize(safe - trace_endpos) * 0;
 	tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, to, MOVE_NOMONSTERS, player);
 	if(trace_startsolid)
-		error("trace_endpos in solid!");
+	{
+		print("trace_endpos in solid, this can't be!\n");
+		// FAIL TODO why does this happen? (reported by MrBougo)
+		return 0;
+	}
 	to = trace_endpos + normalize(safe - trace_endpos) * 0;
 	//print(vtos(to), "\n");
 
@@ -523,13 +524,18 @@
 	}
 	return 1;
 }
-void Portal_ClearAll(entity own)
+void Portal_ClearAll_PortalsOnly(entity own)
 {
 	if(own.portal_in)
 		Portal_Remove(own.portal_in, 0);
 	if(own.portal_out)
 		Portal_Remove(own.portal_out, 0);
 }
+void Portal_ClearAll(entity own)
+{
+	Portal_ClearAll_PortalsOnly(own);
+	W_Porto_Remove(own);
+}
 void Portal_RemoveLater_Think()
 {
 	Portal_Remove(self, self.cnt);
@@ -541,13 +547,18 @@
 	portal.think = Portal_RemoveLater_Think;
 	portal.nextthink = time;
 }
-void Portal_ClearAllLater(entity own)
+void Portal_ClearAllLater_PortalsOnly(entity own)
 {
 	if(own.portal_in)
 		Portal_RemoveLater(own.portal_in, 0);
 	if(own.portal_out)
 		Portal_RemoveLater(own.portal_out, 0);
 }
+void Portal_ClearAllLater(entity own)
+{
+	Portal_ClearAllLater_PortalsOnly(own);
+	W_Porto_Remove(own);
+}
 void Portal_ClearWithID(entity own, float id)
 {
 	if(own.portal_in)
@@ -614,8 +625,8 @@
 	portal = Portal_Spawn(own, org, ang);
 	if(!portal)
 	{
-		if(!self.portal_out || self.portal_out.portal_id == portal_id_val)
-			Portal_ClearAll(own);
+		// if(!own.portal_out || own.portal_out.portal_id == portal_id_val)
+			Portal_ClearAll_PortalsOnly(own);
 		return 0;
 	}
 
@@ -638,8 +649,8 @@
 	portal = Portal_Spawn(own, org, ang);
 	if(!portal)
 	{
-		if(!self.portal_in || self.portal_in.portal_id == portal_id_val)
-			Portal_ClearAll(own);
+		// if(!own.portal_in || own.portal_in.portal_id == portal_id_val)
+			Portal_ClearAll_PortalsOnly(own);
 		return 0;
 	}
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/portals.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/portals.qh	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/portals.qh	2008-10-07 07:55:43 UTC (rev 4650)
@@ -1,3 +1,6 @@
+.float portal_id;
+.entity portal_in, portal_out;
+
 void Portal_ClearAll(entity own);
 void Portal_ClearAllLater(entity own);
 float Portal_SpawnOutPortalAtTrace(entity own, vector dir, float id);

Modified: branches/nexuiz-2.0/data/qcsrc/server/race.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/race.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/race.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -96,7 +96,7 @@
 		else
 		{
 			s = PlayerScore_Add(e, SP_RACE_TIME, 0);
-			snew = floor(0.5 + 10 * (time - restart_countdown));
+			snew = floor(0.5 + 10 * (time - game_starttime));
 			PlayerScore_Add(e, SP_RACE_TIME, snew - s);
 			l = PlayerTeamScore_Add(e, SP_RACE_LAPS, ST_RACE_LAPS, 1);
 
@@ -309,7 +309,6 @@
 void checkpoint_passed()
 {
 	string oldmsg;
-	entity oldself;
 
 	if(other.classname == "porto")
 	{
@@ -339,13 +338,6 @@
 	 * Remove unauthorized equipment
 	 */
 	Portal_ClearAll(other);
-	if(other.porto_current)
-	{
-		oldself = self;
-		self = other.porto_current;
-		W_Porto_Fail(1);
-		self = oldself;
-	}
 
 	other.porto_forbidden = 2; // decreased by 1 each StartFrame
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/runematch.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/runematch.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -151,7 +151,7 @@
 	vector ang;
 	entity rune;
 
-	if(self.owner.classname != "player" || time < restart_countdown)
+	if(self.owner.classname != "player" || time < game_starttime)
 	{
 		rune_respawn();
 		return;

Modified: branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -158,7 +158,7 @@
 	// if in warmup stage and limit for warmup is hit start match
 	if (inWarmupStage
 	    && 0 < g_warmup_limit
-	    && (time + RESTART_COUNTDOWN) >= g_warmup_limit)
+	    && time >= g_warmup_limit)
 	{
 		ReadyRestart();
 		return;

Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -368,7 +368,7 @@
 	self.welcomemessage_time = time + 0.8; */
 
 	if(self.cvar_scr_centertime == 0) return;
-	if( !(timeoutStatus >= 1 || (time < restart_countdown) ) ) { //really print the WelcomeMessage to the player every frame when timeout-seconds are shown or the game is restarted, to make sure that the shown number is accurate
+	if( !(timeoutStatus >= 1 || (time < game_starttime) ) ) { //really print the WelcomeMessage to the player every frame when timeout-seconds are shown or the game is restarted, to make sure that the shown number is accurate
 		if(self.welcomemessage_time > time) return;
 		self.welcomemessage_time = time + self.cvar_scr_centertime * 0.6;
 	}
@@ -384,7 +384,7 @@
 		// TODO get rid of this too
 		local string specString;
 		specString = NEWLINES;
-		if(time < restart_countdown) //also show the countdown when being a spectator
+		if(time < game_starttime) //also show the countdown when being a spectator
 			specString = strcat(specString, "\n\n^1Game starts in ", ftos(restartAnnouncer.cnt + 1), " seconds^7");
 		else if (timeoutStatus != 0)
 			specString = strcat(specString, "\n\n", getTimeoutText(1));
@@ -452,7 +452,7 @@
 	if(modifications != "")
 		s = strcat(s, "^8\nactive modifications: ^3", modifications, "^8\n");
 
-	if(time < restart_countdown)
+	if(time < game_starttime)
 		s = strcat(s, "\n^1Game starts in ", ftos(restartAnnouncer.cnt + 1), " seconds^7");
 
 	if(timeoutStatus != 0)

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_porto.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_porto.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_porto.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -1,4 +1,3 @@
-.float portal_id;
 .entity porto_current;
 .vector porto_v_angle; // holds "held" view angles
 .float porto_v_angle_held;
@@ -29,7 +28,7 @@
 	Portal_ClearWithID(self.owner, self.portal_id);
 	self.owner.porto_current = world;
 
-	if(!failhard && !(self.owner.weapons & WEPBIT_PORTO))
+	if(!failhard && self.owner.playerid == self.playerid && self.owner.deadflag == DEAD_NO && !(self.owner.weapons & WEPBIT_PORTO))
 	{
 		setsize (self, '-16 -16 0', '16 16 32');
 		setorigin(self, self.origin + trace_plane_normal);
@@ -48,6 +47,18 @@
 	remove(self);
 }
 
+void W_Porto_Remove (entity p)
+{
+	if(p.porto_current)
+	{
+		entity oldself;
+		oldself = self;
+		self = p.porto_current;
+		W_Porto_Fail(1);
+		self = oldself;
+	}
+}
+
 void W_Porto_Think (void)
 {
 	trace_plane_normal = '0 0 0';
@@ -113,12 +124,20 @@
 	}
 	else
 	{
-		if(Portal_SpawnOutPortalAtTrace(self.owner, self.right_vector, self.portal_id))
+		if(self.owner.portal_in.portal_id == self.portal_id)
 		{
-			sound(self, CHAN_PROJECTILE, "porto/create.ogg", VOL_BASE, ATTN_NORM);
-			trace_plane_normal = norm;
-			centerprint(self.owner, "^4Out^7-portal created.\n");
-			W_Porto_Success();
+			if(Portal_SpawnOutPortalAtTrace(self.owner, self.right_vector, self.portal_id))
+			{
+				sound(self, CHAN_PROJECTILE, "porto/create.ogg", VOL_BASE, ATTN_NORM);
+				trace_plane_normal = norm;
+				centerprint(self.owner, "^4Out^7-portal created.\n");
+				W_Porto_Success();
+			}
+			else
+			{
+				sound(self, CHAN_PROJECTILE, "porto/unsupported.ogg", VOL_BASE, ATTN_NORM);
+				W_Porto_Fail(0);
+			}
 		}
 		else
 		{
@@ -141,6 +160,7 @@
 
 	gren = spawn ();
 	gren.owner = self;
+	gren.playerid = self.playerid;
 	gren.classname = "porto";
 	gren.bot_dodge = TRUE;
 	gren.bot_dodgerating = 200;

Modified: branches/nexuiz-2.0/data/qcsrc/server/waypointsprites.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/waypointsprites.qc	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/qcsrc/server/waypointsprites.qc	2008-10-07 07:55:43 UTC (rev 4650)
@@ -26,12 +26,16 @@
 
 void WaypointSprite_UpdateOrigin(entity e, vector o)
 {
-	e.origin = o;
-	e.SendFlags |= 128;
+	if(o != e.origin)
+	{
+		e.origin = o;
+		e.SendFlags |= 128;
+	}
 }
 
 void WaypointSprite_UpdateRule(entity e, float t, float r)
 {
+	// no check, as this is never called without doing an actual change (usually only once)
 	e.rule = r;
 	e.team = t;
 	e.SendFlags |= 1;
@@ -39,13 +43,15 @@
 
 void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col)
 {
-	e.cnt = (icon & 0x7F);
+	// no check, as this is never called without doing an actual change (usually only once)
+	e.cnt = (icon & 0x7F) | (e.cnt & 0x80);
 	e.colormod = col;
 	e.SendFlags |= 32;
 }
 
 void WaypointSprite_Ping(entity e)
 {
+	// ALWAYS sends (this causes a radar circle), thus no check
 	e.cnt |= 0x80;
 	e.SendFlags |= 32;
 }

Modified: branches/nexuiz-2.0/data/scripts/entities.def
===================================================================
--- branches/nexuiz-2.0/data/scripts/entities.def	2008-10-07 06:02:50 UTC (rev 4649)
+++ branches/nexuiz-2.0/data/scripts/entities.def	2008-10-07 07:55:43 UTC (rev 4650)
@@ -27,7 +27,7 @@
 noise1: Sound to be played to all players when the control point is captured.  Also good for an announcer voice ("Red Team has captured a control point")
 */
 
-/*QUAKED func_assault_destructible (.5 0 .5) (-8 -8 -8) (8 8 8) 
+/*QUAKED func_assault_destructible (.5 0 .5) ?
 This is a brush model which can be damaged. Once triggered it's active and will happily receive damage players inflict upon it. Once all health is consumed it'll disappear and trigger the targeted entity/entities. As damage is received the brush model will be tinted in an increasingly visible flavor of red to give visible feedback.
 -------- KEYS --------
 health: The damage this trigger can take
@@ -35,7 +35,7 @@
 targetname: The name other entities can use to target this entity
 */
 
-/*QUAKED func_assault_wall (.5 0 .5) (-8 -8 -8) (8 8 8) 
+/*QUAKED func_assault_wall (.5 0 .5) ?
 Brush model that will disappear once the targeted target_objective is fulfilled. This can be used to restrict access to parts of the map until a certain objective has been conquered.
 -------- KEYS --------
 target: targetname of a target_objective




More information about the nexuiz-commits mailing list