[nexuiz-commits] r6333 - in branches/nexuiz-2.0: . data data/maps data/models data/models/items data/models/turrets data/qcsrc/client data/qcsrc/common data/qcsrc/menu/nexuiz data/qcsrc/server data/qcsrc/server/tturrets/include data/qcsrc/server/tturrets/system data/qcsrc/server/tturrets/units data/scripts data/sound/misc data/textures misc misc/tools

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Mar 27 14:16:44 EDT 2009


Author: div0
Date: 2009-03-27 14:16:42 -0400 (Fri, 27 Mar 2009)
New Revision: 6333

Added:
   branches/nexuiz-2.0/data/models/marker.md3
   branches/nexuiz-2.0/data/models/marker.md3_0.skin
   branches/nexuiz-2.0/data/models/marker.md3_1.skin
   branches/nexuiz-2.0/data/models/marker.md3_2.skin
   branches/nexuiz-2.0/data/models/marker.md3_3.skin
   branches/nexuiz-2.0/data/qcsrc/client/effects.qc
   branches/nexuiz-2.0/data/qcsrc/server/csqceffects.qc
   branches/nexuiz-2.0/data/sound/misc/jetpack_fly.ogg
   branches/nexuiz-2.0/data/textures/pickups.tga
   branches/nexuiz-2.0/data/textures/pickups_bump.tga
   branches/nexuiz-2.0/data/textures/pickups_gloss.tga
   branches/nexuiz-2.0/data/textures/pickups_glow.tga
   branches/nexuiz-2.0/misc/netradiant-NexuizPack/
Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/Makefile
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/keybinds.txt
   branches/nexuiz-2.0/data/maps/campaignNexuiz20.txt
   branches/nexuiz-2.0/data/maps/campaignNexuiz25.txt
   branches/nexuiz-2.0/data/models/items/g_a1.md3
   branches/nexuiz-2.0/data/models/items/g_a25.md3
   branches/nexuiz-2.0/data/models/items/g_armormedium.md3
   branches/nexuiz-2.0/data/models/items/g_h1.md3
   branches/nexuiz-2.0/data/models/items/g_h100.md3
   branches/nexuiz-2.0/data/models/items/g_h25.md3
   branches/nexuiz-2.0/data/models/items/g_h50.md3
   branches/nexuiz-2.0/data/models/turrets/base.md3
   branches/nexuiz-2.0/data/models/turrets/ewheel-base.md3
   branches/nexuiz-2.0/data/models/turrets/ewheel-gun1.md3
   branches/nexuiz-2.0/data/models/turrets/flac.md3
   branches/nexuiz-2.0/data/models/turrets/fusion_top.md3
   branches/nexuiz-2.0/data/models/turrets/fusreac.md3
   branches/nexuiz-2.0/data/models/turrets/hellion.md3
   branches/nexuiz-2.0/data/models/turrets/machinegun.md3
   branches/nexuiz-2.0/data/models/turrets/phaser.md3
   branches/nexuiz-2.0/data/models/turrets/plasmad.md3
   branches/nexuiz-2.0/data/models/turrets/reactor.md3
   branches/nexuiz-2.0/data/models/turrets/tesla_base.md3
   branches/nexuiz-2.0/data/models/turrets/tesla_head.md3
   branches/nexuiz-2.0/data/models/turrets/walker_body.md3
   branches/nexuiz-2.0/data/models/turrets/walker_head_minigun.md3
   branches/nexuiz-2.0/data/qcsrc/client/Main.qc
   branches/nexuiz-2.0/data/qcsrc/client/progs.src
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/common/constants.qh
   branches/nexuiz-2.0/data/qcsrc/common/items.qh
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_effects.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_input.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_misc.c
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/util.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   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/g_hook.qc
   branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
   branches/nexuiz-2.0/data/qcsrc/server/movelib.qc
   branches/nexuiz-2.0/data/qcsrc/server/pathlib.qc
   branches/nexuiz-2.0/data/qcsrc/server/progs.src
   branches/nexuiz-2.0/data/qcsrc/server/steerlib.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_jumppads.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc
   branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/include/turrets_early.qh
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_damage.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_main.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_misc.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_ewheel.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_flac.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_fusionreactor.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hellion.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hk.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_machinegun.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_mlrs.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_phaser.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_plasma.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_targettrigger.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_tessla.qc
   branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_walker.qc
   branches/nexuiz-2.0/data/qcsrc/server/verbstack.qc
   branches/nexuiz-2.0/data/qcsrc/server/vote.qc
   branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc
   branches/nexuiz-2.0/data/scripts/entities.def
   branches/nexuiz-2.0/data/unit_ewheel.cfg
   branches/nexuiz-2.0/data/unit_flac.cfg
   branches/nexuiz-2.0/data/unit_fusreac.cfg
   branches/nexuiz-2.0/data/unit_hellion.cfg
   branches/nexuiz-2.0/data/unit_hk.cfg
   branches/nexuiz-2.0/data/unit_machinegun.cfg
   branches/nexuiz-2.0/data/unit_mlrs.cfg
   branches/nexuiz-2.0/data/unit_phaser.cfg
   branches/nexuiz-2.0/data/unit_plasma.cfg
   branches/nexuiz-2.0/data/unit_plasma2.cfg
   branches/nexuiz-2.0/data/unit_tesla.cfg
   branches/nexuiz-2.0/data/unit_walker.cfg
   branches/nexuiz-2.0/misc/tools/nexuiz-map-compiler
Log:
r6285 | div0 | 2009-03-25 20:48:54 +0100 (Wed, 25 Mar 2009) | 2 lines
feature not for 2.5: jetpack
r6286 | div0 | 2009-03-25 20:52:47 +0100 (Wed, 25 Mar 2009) | 2 lines
fix jetpack acceleration
r6287 | div0 | 2009-03-25 20:54:19 +0100 (Wed, 25 Mar 2009) | 2 lines
fix jetpack when out of ammo
r6288 | div0 | 2009-03-25 21:01:15 +0100 (Wed, 25 Mar 2009) | 2 lines
jetpack: show remaining ammo
r6289 | div0 | 2009-03-25 21:05:31 +0100 (Wed, 25 Mar 2009) | 2 lines
cvar check
r6290 | div0 | 2009-03-25 21:06:59 +0100 (Wed, 25 Mar 2009) | 2 lines
damn, add a missing check
r6291 | div0 | 2009-03-25 21:07:36 +0100 (Wed, 25 Mar 2009) | 2 lines
s/ammo/fuel/ :P
r6292 | div0 | 2009-03-25 21:21:32 +0100 (Wed, 25 Mar 2009) | 2 lines
jetpack: less upspeed
r6293 | div0 | 2009-03-25 21:31:35 +0100 (Wed, 25 Mar 2009) | 2 lines
even less up speed
r6294 | div0 | 2009-03-26 07:23:17 +0100 (Thu, 26 Mar 2009) | 2 lines
weapon stay 2: allow ammo from dropped weapons
r6295 | div0 | 2009-03-26 08:10:46 +0100 (Thu, 26 Mar 2009) | 2 lines
undo MF_ROCKET
r6296 | div0 | 2009-03-26 09:32:08 +0100 (Thu, 26 Mar 2009) | 2 lines
new and better jetpack code and settings
r6297 | div0 | 2009-03-26 09:42:11 +0100 (Thu, 26 Mar 2009) | 3 lines
Add a team check to trigger_teleport and trigger_push, for team-owned teleporters and jumppads (e.g. for onslaught).
Team-owned jumppads can also be used as force fields that only one team can pass (use the INVERT_TEAM spawnflag for that).
r6298 | div0 | 2009-03-26 09:45:38 +0100 (Thu, 26 Mar 2009) | 2 lines
cvar check
r6299 | div0 | 2009-03-26 09:58:56 +0100 (Thu, 26 Mar 2009) | 2 lines
fix insane ammo consumption when trying to move down :P
r6300 | div0 | 2009-03-26 10:17:51 +0100 (Thu, 26 Mar 2009) | 2 lines
jetpack fuel HUD
r6301 | div0 | 2009-03-26 10:27:51 +0100 (Thu, 26 Mar 2009) | 2 lines
now twice as expensive (jetpack)
r6302 | div0 | 2009-03-26 10:46:47 +0100 (Thu, 26 Mar 2009) | 2 lines
jetpack: more control
r6303 | div0 | 2009-03-26 10:49:13 +0100 (Thu, 26 Mar 2009) | 2 lines
slightly less control again, but more upwards speed
r6304 | div0 | 2009-03-26 10:59:14 +0100 (Thu, 26 Mar 2009) | 2 lines
fix g_weapon_stay 2, and make it the default in the menu for weapon stay mutator
r6305 | div0 | 2009-03-26 16:47:53 +0100 (Thu, 26 Mar 2009) | 2 lines
put NetRadiant's NexuizPack here
r6306 | div0 | 2009-03-26 17:26:25 +0100 (Thu, 26 Mar 2009) | 2 lines
make jetpack able to coexist with hook (only the weapon one); add it to the mutators dialog
r6307 | div0 | 2009-03-26 17:27:08 +0100 (Thu, 26 Mar 2009) | 2 lines
if g_jetpack, set some starting cells
r6308 | div0 | 2009-03-26 17:28:48 +0100 (Thu, 26 Mar 2009) | 2 lines
add jetpack to keybinds
r6309 | div0 | 2009-03-26 17:38:17 +0100 (Thu, 26 Mar 2009) | 2 lines
jetpack: 3 ammo/sec. Finally this should be good... even for 2teams1base.
r6310 | div0 | 2009-03-26 17:53:51 +0100 (Thu, 26 Mar 2009) | 3 lines
jetpack: support unlimited ammo
hook: decrease ammo gradually, not one by one
r6311 | div0 | 2009-03-26 18:04:03 +0100 (Thu, 26 Mar 2009) | 2 lines
hook: unlimited ammo PROPER handling
r6312 | div0 | 2009-03-26 18:13:07 +0100 (Thu, 26 Mar 2009) | 2 lines
fix an acceleration bug in the jetpack
r6313 | esteel | 2009-03-26 23:00:27 +0100 (Thu, 26 Mar 2009) | 2 lines
fix typo.. in case the bot count was the typo please change again :)
r6314 | div0 | 2009-03-27 08:18:15 +0100 (Fri, 27 Mar 2009) | 2 lines
yet another fteqcc bug
r6315 | tzork | 2009-03-27 09:24:26 +0100 (Fri, 27 Mar 2009) | 1 line
Add TE_CSQC_LIGHTNINGARC
r6316 | esteel | 2009-03-27 09:31:39 +0100 (Fri, 27 Mar 2009) | 1 line
typo fixes by victim (I turned numbers < 10 into text though)
r6317 | tzork | 2009-03-27 09:56:37 +0100 (Fri, 27 Mar 2009) | 1 line
Add TE_CSQC_LIGHTNINGARC (server)
r6318 | tzork | 2009-03-27 09:57:06 +0100 (Fri, 27 Mar 2009) | 1 line
Lib updates
r6319 | tzork | 2009-03-27 10:36:50 +0100 (Fri, 27 Mar 2009) | 13 lines
Better walker and ewheel.
Better fix for NaN angles (fixed turret_stdproc_track)
Fix unhanded damage type 0 on turret blow up
Support TFL_SHOOT_CUSTOM
Fix broken support units with TFL_TARGETSELECT_NOTURRETS
Fix idle_aim / defend aim
Fix missed body damage on support units
Fix in turret_tag_setup/turret_tag_fire_update for mangled md3 tags
Make tesla use te_csqc_lightningarc.
Restructure tela to conform a bit better.
Removed some un/rarely used crap
Updated units for above changes.
Fix harmless warning in pathlib
r6320 | div0 | 2009-03-27 11:07:15 +0100 (Fri, 27 Mar 2009) | 2 lines
add some effects cvars
r6321 | tzork | 2009-03-27 11:12:07 +0100 (Fri, 27 Mar 2009) | 1 line
Wops. crash fix.
r6322 | div0 | 2009-03-27 11:21:58 +0100 (Fri, 27 Mar 2009) | 2 lines
make sure entities.def stays in sync
r6323 | tzork | 2009-03-27 11:46:25 +0100 (Fri, 27 Mar 2009) | 1 line
Turret config updates.
r6324 | tzork | 2009-03-27 11:47:15 +0100 (Fri, 27 Mar 2009) | 1 line
+one
r6325 | tzork | 2009-03-27 11:48:47 +0100 (Fri, 27 Mar 2009) | 1 line
Updated turret models (fixed normals) + marker.md3 for debug.
r6326 | div0 | 2009-03-27 12:58:18 +0100 (Fri, 27 Mar 2009) | 2 lines
jetpack fly sound
r6327 | esteel | 2009-03-27 13:24:55 +0100 (Fri, 27 Mar 2009) | 2 lines
fix sv_vote_nospectators 1 blocking admins from using sv_cmd vote call..
r6328 | div0 | 2009-03-27 13:30:44 +0100 (Fri, 27 Mar 2009) | 2 lines
turn off jetpack sound when dead
r6329 | tzork | 2009-03-27 13:48:37 +0100 (Fri, 27 Mar 2009) | 1 line
texture atlas hp/ar pickups.
r6330 | div0 | 2009-03-27 13:51:25 +0100 (Fri, 27 Mar 2009) | 2 lines
now REALLY make sure jetpack sound turns off
r6331 | div0 | 2009-03-27 15:56:06 +0100 (Fri, 27 Mar 2009) | 2 lines
protect dom points for 0.3s
r6332 | div0 | 2009-03-27 16:52:48 +0100 (Fri, 27 Mar 2009) | 2 lines
add a cvar menu_updatecheck that can be used to turn off update checking


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/.patchsets	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-6039,6044-6283
+revisions_applied = 1-6039,6044-6332

Modified: branches/nexuiz-2.0/data/Makefile
===================================================================
--- branches/nexuiz-2.0/data/Makefile	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/Makefile	2009-03-27 18:16:42 UTC (rev 6333)
@@ -16,6 +16,7 @@
 
 .PHONY: update-cvarcount
 update-cvarcount:
+	! [ -f ../misc/netradiant-NexuizPack/nexuiz.game/data/entities.def ] || diff ../misc/netradiant-NexuizPack/nexuiz.game/data/entities.def scripts/entities.def || { echo entities.def mismatch, please merge ../misc/netradiant-NexuizPack/nexuiz.game/data/entities.def and scripts/entities.def; exit 1; }
 	DO_NOT_RUN_MAKE=1 sh update-cvarcount.sh
 
 .PHONY: qc

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -24,7 +24,7 @@
 seta g_configversion 0	"Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1  Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
 
 // default.cfg versioning (update using update-cvarcount.sh, run that every time after adding a new cvar)
-set cvar_check_default 536ebc4385079e467b5b49c21ff625e5
+set cvar_check_default c57e95e5c45c75494b2b35e5edaad80c
 
 // Nexuiz version (formatted for machines)
 // used to determine if a client version is compatible
@@ -1415,3 +1415,20 @@
 
 seta cl_showpressedkeys	0	"Show which movement keys someone is pressing: 1 for spectating, 2 for always"
 set cl_showpressedkeys_position "1 0.8"	"1 0 would be upper right corner, 0.5 0.5 the center"
+
+set g_jetpack 0 "Jetpack mutator (uses the hook's button, can't coexist with the offhand hook, but only with the onhand one)"
+set g_jetpack_antigravity 0.8 "factor of gravity compensation of the jetpack"
+set g_jetpack_acceleration_side 1200 "acceleration of the jetpack in xy direction"
+set g_jetpack_acceleration_up 600 "acceleration of the jetpack in z direction (note: you have to factor in gravity here, if antigravity is not 1)"
+set g_jetpack_maxspeed_side 1500 "max speed of the jetpack in xy direction"
+set g_jetpack_maxspeed_up 600 "max speed of the jetpack in z direction"
+set g_jetpack_ammo 3 "cells per second for jetpack" 
+
+set cl_effects_lightningarc_simple 0
+set cl_effects_lightningarc_segmentlength 64
+set cl_effects_lightningarc_drift_start 0.45
+set cl_effects_lightningarc_drift_end 0.1
+set cl_effects_lightningarc_branchfactor_start 0.25
+set cl_effects_lightningarc_branchfactor_add 0.1
+
+set menu_updatecheck 1

Modified: branches/nexuiz-2.0/data/keybinds.txt
===================================================================
--- branches/nexuiz-2.0/data/keybinds.txt	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/keybinds.txt	2009-03-27 18:16:42 UTC (rev 6333)
@@ -5,7 +5,7 @@
 "+moveright"                            "strafe right"
 "+jump"                                 "jump / swim"
 "+crouch"                               "crouch / sink"
-"+hook"                                 "off-hand hook"
+"+hook"                                 "off-hand hook / jet pack"
 ""                                      ""
 ""                                      "Attacking"
 "+attack"                               "primary fire"

Modified: branches/nexuiz-2.0/data/maps/campaignNexuiz20.txt
===================================================================
--- branches/nexuiz-2.0/data/maps/campaignNexuiz20.txt	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/maps/campaignNexuiz20.txt	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,24 +1,24 @@
 "//campaign:Nexuiz 2.0 Campaign"
 "//game","mapname","bots","skill","frag","mutator-sets","description","long description"
-"dm","downer","2","3","15",,"Downer","Welcome to your first taste of campaign deathmatch!\n\nYou will face off against two unskilled bots in the decaying industrial arena known as Downer with a fraglimit of 15, this should be good practice for later, so make the best of it."
-"dm","basement","3","3","10",,"Basement","Frenzied deathmatch in Basement against three bots, fraglimit is 10."
-"dm","skyway","2","3","15","g_weaponarena rocketlauncher","Rocket Arena on Skyway","Rocket Arena DM mode!\n\n3 bots, everyone will start with Rocket Launchers with unlimited ammo.\n\nRemember, you can detonate your rockets in midair with the secondary fire, this is useful for getting the most damage.\n\nFraglimit of 15."
-"tdm","toxic","3","4","20",,"Team DM on Toxic","Team deathmatch.\n\nYou will have one bot team mate on your team now against a team of 2.\n\nFraglimit of 20."
-"dom","bleach","3","4","200",,"Domination on Bleach","Capture and hold the Domination Points.\n\nThe more points your team owns, the more rapidly your team gains points.\n\nOne bot on your team against 2, first team to reach 200 points wins."
-"dm","silvercity","4","4","15","g_minstagib 1; sv_gravity 200","Silver City","Low gravity minstagib!\n\nYou face 4 bots and a fraglimit of 15 in this huge outdoor arena.\n\nWith the low gravity you should be able to navigate easily.\n\nBe careful not to run out of ammo or you will die within 10 seconds if you do not pick up a dropped Nex."
-"dm","reslimed","3","5","15","g_vampire 1","Slimepit Revisited","Vampire Deathmatch against 3 bots in the Slime Pit with a fraglimit of 15.\n\nYou are healed by doing damage."
-"dm","bluesky","3","5","15",,"Blue Sky","In this fairly odd Deathmatch level there are 3 skilled bots with a fraglimit of 15."
-"tdm","dieselpower","7","5","20",,"Team DM on Dieselpower","Team deathmatch again.\n\nFraglimit of 20.\n\nThis time your team has to win on dieselpower."
-"dm","aggressor","3","5","15",,"Aggressor","In this Deathmatch level you face 3 skilled bots with a fraglimit of 15."
-"ctf","basementctf","3","7","60",,"CTF on Basement","Teams face off in this Capture The Flag arena with the goal of stealing the other team's flag and returning it to their own.\n\nBe sure to kill any enemies carrying your team's flag and touch it to return it to your base.\n\nFirst team to score 60 points wins."
-"dm","evilspace","3","5","10",,"Evil Space","Deathmatch in a space map against 3 bots.\n\nFraglimit of 10.\n\nPush your opponents off the map and try not to fall off yourself."
-"dm","soylent","3","6","10",,"Soylent Space","Turn people into paste in this space arena.\n\n3 bots and a fraglimit of 10."
-"dm","runningman_1on1remix","1","6","10","g_footsteps 1","1on1 on Running Man","In this arena titled 'Running Man' you will face off against only one opponent to a fraglimit of 10.\n\nWill you be the victor?"
-"kh","aneurysm","3","7","500",,"Aneurysm","Keyhunt in another industrial Deathmatch arena.  Team up with one bot against two others.\nTo score the big points your team has to get all keys and meet!\nOr be selfish and get the keys yourself."
-"dm","darkzone","4","7","15",,"Q1Dm6 remake","This is a remake of a beloved level from the original Quake(r) from id Software, simple Deathmatch against 4 bots to a fraglimit of 15."
-"dm","stormkeep","5","8","15","g_laserguided_missile 1; g_weaponarena rocketlauncher","LG missiles on StormKeep","Destroy your opponents with Laser guided missiles in the StormKeep arena, you are up against 5 bots and a fraglimit of 15.\n\nRocket Launcher altfire toggles laser guidance."
+"dm","downer","2","3","15",,"Downer","Welcome to your first taste of campaign Deathmatch!\n\nYou will face off against two unskilled bots in the decaying industrial arena known as Downer.\n\nWith a fraglimit of 15, this should be good practice for later, so make the best of it."
+"dm","basement","3","3","10",,"Basement","Frenzied Deathmatch in Basement against three bots, fraglimit is 10."
+"dm","skyway","2","3","15","g_weaponarena rocketlauncher","Rocket Arena on Skyway","Rocket Arena Deathmatch mode!\n\nTwo bots, everyone will start with Rocket Launchers with unlimited ammo.\n\nRemember, you can detonate your rockets in midair with the secondary fire, this is useful for getting the most damage.\n\nFraglimit of 15."
+"tdm","toxic","3","4","20",,"Team DM on Toxic","Team Deathmatch.\n\nYou will have one bot team mate on your team now against a team of two.\n\nFraglimit of 20."
+"dom","bleach","3","4","200",,"Domination on Bleach","Capture and hold the Domination Points.\n\nThe more points your team controls, the more rapidly your team gains points.\n\nOne bot on your team against two, first team to reach 200 points wins."
+"dm","silvercity","4","4","15","g_minstagib 1; sv_gravity 200","Silver City","Low gravity Minstagib!\n\nYou face four bots and a fraglimit of 15 in this huge outdoor arena.\n\nWith the low gravity you should be able to navigate easily.\n\nYou will die within 10 seconds if you run out of ammo.\n\nPick up an energy cell or a dropped Nex."
+"dm","reslimed","3","5","15","g_vampire 1","Slimepit Revisited","Vampire Deathmatch against three bots in the Slime Pit with a fraglimit of 15.\n\nYou are healed by doing damage."
+"dm","bluesky","3","5","15",,"Blue Sky","In this fairly odd Deathmatch level there are three skilled bots with a fraglimit of 15."
+"tdm","dieselpower","7","5","20",,"Team DM on Dieselpower","Team Deathmatch again.\n\nFraglimit of 20.\n\nThis time your team has to win on Dieselpower."
+"dm","aggressor","3","5","15",,"Aggressor","In this Deathmatch level you face three skilled bots with a fraglimit of 15."
+"ctf","basementctf","3","7","60",,"CTF on Basement","Teams face off in this Capture The Flag arena with the goal of stealing the other teams flag and returning it to your own base.\n\nBe sure to kill any enemies carrying your teams flag and touch it to return it to your base.\n\nFirst team to score 60 points wins."
+"dm","evilspace","3","5","10",,"Evil Space","Deathmatch in a space map against three bots.\n\nFraglimit of 10.\n\nPush your opponents off the map and try not to fall off yourself."
+"dm","soylent","3","6","10",,"Soylent Space","Turn people into paste in this space arena.\n\nThree bots and a fraglimit of 10."
+"dm","runningman_1on1remix","1","6","10","g_footsteps 1","1on1 on Running Man","In this arena titled Running Man you will face off against only one opponent to a fraglimit of 10.\n\nWill you be the victor?"
+"kh","aneurysm","3","7","500",,"Aneurysm","Keyhunt in another industrial Deathmatch arena. Team up with one bot against two others.\nTo score the big points your team has to get all keys and meet!\nOr be selfish and get the keys yourself."
+"dm","darkzone","4","7","15",,"Q1Dm6 remake","This is a remake of a beloved level from the original Quake(r) from id Software, simple Deathmatch against four bots to a fraglimit of 15."
+"dm","stormkeep","5","8","15","g_laserguided_missile 1; g_weaponarena rocketlauncher","LG missiles on StormKeep","Destroy your opponents with Laser Guided missiles in the StormKeep arena, you are up against five bots and a fraglimit of 15.\n\nThe Rocket Launcher alt-fire toggles laser guidance."
 "lms","bloodprison","3","8","9",,"LMS on Blood Prison","Last Man Standing in Blood Prison, like a cat, you have nine lives.\n\nWill you survive?"
-"dm","farewell","3","9","20","g_weaponarena rocketlauncher","Farewell","Rocket Arena returns in the arena Farewell, 3 bots, fraglimit of 20."
-"dm","warfare","3","9","15",,"Warfare","In Stabilized Warfare you face 3 bots, and a fraglimit of 15."
-"dm","starship","3","10","15",,"Starship","You are getting closer. Only this map before you get to the final fight.\n3 bots with a 15 frag limit in the Starship arena."
-"dm","final_rage","3","10","15",,"Final RAGE!","The final battle on final rage - Now its 4 bots with a 15 frag limit .\n\nAre you up to the challenge?"
+"dm","farewell","3","9","20","g_weaponarena rocketlauncher","Farewell","Rocket Arena returns in the arena Farewell, three bots, fraglimit of 20."
+"dm","warfare","3","9","15",,"Warfare","In Stabilized Warfare you face three bots, and a fraglimit of 15."
+"dm","starship","3","10","15",,"Starship","You are getting close. Only this map before you get to the final fight.\nThree bots with a 15 fraglimit in the Starship arena."
+"dm","final_rage","4","10","15",,"Final RAGE!","The final battle on Final Rage\n\nNow it's four highly skilled bots with a 15 fraglimit.\n\nAre you up to the challenge?"

Modified: branches/nexuiz-2.0/data/maps/campaignNexuiz25.txt
===================================================================
--- branches/nexuiz-2.0/data/maps/campaignNexuiz25.txt	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/maps/campaignNexuiz25.txt	2009-03-27 18:16:42 UTC (rev 6333)
@@ -4,7 +4,7 @@
 "dm","darkzone",2,2,15,,"DM: Q1DM6 Remake","On this remake of a beloved level from the original Quake(r) from id Software, you'll face two bots on a somewhat higher skill level.\n\n15 frags will make you a winner here."
 "dm","desertfactory",3,3,20,,"DM: Desert Factory","You're fighting three enemies in a deserted factory. Watch out for the hot pipes, as they can kill you.\n\nThe game ends once someone, hopefully you, will have 20 frags."
 "dm","soylent",1,4,20,,"DM: Soylent Space","This time, you will face a single bot on an interesting space arena that allows many movement tricks. Try to learn these tricks so you can find your enemy faster.\n\nYou win once you have 20 frags."
-"dm","skyway",3,3,15,"g_minstagib 1","SPECIAL: Skyway","MinstaGib means that everyone is equipped with a single weapon that both kills with one shot, and can be used for jumping like the Laser can.\n\nLearn using it to fight off the two enemies that somehow have arrived here too!\n\nThe frag limit is 15."
+"dm","skyway",3,3,15,"g_minstagib 1","SPECIAL: Skyway","MinstaGib means that everyone is equipped with a single weapon that both kills with one shot, and can be used for jumping like the Laser can.\n\nLearn using it to fight off the three enemies that somehow have arrived here too!\n\nThe frag limit is 15."
 "dm","starship",4,4,15,"g_nixnex 1","SPECIAL: Starship","In NixNex, your weapon is cycled randomly, and everyone always has the same weapon but limited ammo.\n\nFight four bots in a starship especially built for fighting inside."
 "tdm","toxic",3,2,20,,"TDM: Toxic","In Team Deathmatch, there are two teams fighting each other. The frags of each team are added up, and the first team reaching 20 frags wins.\n\nMake your team this winning team!"
 "tdm","aggressor",3,3,20,,"TDM: Aggressor","Now that you are getting the hang of team deathmatch, let's increase the skill of the bots.\n\nTry to keep them from fragging you!"

Modified: branches/nexuiz-2.0/data/models/items/g_a1.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/items/g_a25.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/items/g_armormedium.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/items/g_h1.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/items/g_h100.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/items/g_h25.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/items/g_h50.md3
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/models/marker.md3 (from rev 6332, trunk/data/models/marker.md3)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/models/marker.md3_0.skin (from rev 6332, trunk/data/models/marker.md3_0.skin)
===================================================================
--- branches/nexuiz-2.0/data/models/marker.md3_0.skin	                        (rev 0)
+++ branches/nexuiz-2.0/data/models/marker.md3_0.skin	2009-03-27 18:16:42 UTC (rev 6333)
@@ -0,0 +1 @@
+marker,gfx/red

Copied: branches/nexuiz-2.0/data/models/marker.md3_1.skin (from rev 6332, trunk/data/models/marker.md3_1.skin)
===================================================================
--- branches/nexuiz-2.0/data/models/marker.md3_1.skin	                        (rev 0)
+++ branches/nexuiz-2.0/data/models/marker.md3_1.skin	2009-03-27 18:16:42 UTC (rev 6333)
@@ -0,0 +1 @@
+marker,gfx/green

Copied: branches/nexuiz-2.0/data/models/marker.md3_2.skin (from rev 6332, trunk/data/models/marker.md3_2.skin)
===================================================================
--- branches/nexuiz-2.0/data/models/marker.md3_2.skin	                        (rev 0)
+++ branches/nexuiz-2.0/data/models/marker.md3_2.skin	2009-03-27 18:16:42 UTC (rev 6333)
@@ -0,0 +1 @@
+marker,gfx/blue

Copied: branches/nexuiz-2.0/data/models/marker.md3_3.skin (from rev 6332, trunk/data/models/marker.md3_3.skin)
===================================================================
--- branches/nexuiz-2.0/data/models/marker.md3_3.skin	                        (rev 0)
+++ branches/nexuiz-2.0/data/models/marker.md3_3.skin	2009-03-27 18:16:42 UTC (rev 6333)
@@ -0,0 +1 @@
+marker,gfx/white

Modified: branches/nexuiz-2.0/data/models/turrets/base.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/ewheel-base.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/ewheel-gun1.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/flac.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/fusion_top.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/fusreac.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/hellion.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/machinegun.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/phaser.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/plasmad.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/reactor.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/tesla_base.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/tesla_head.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/walker_body.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/models/turrets/walker_head_minigun.md3
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/qcsrc/client/Main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -56,7 +56,7 @@
 	}
 #pragma target FTE
 #endif
-	
+
 	float i;
 	CSQC_CheckEngine();
 	dprint_load();
@@ -114,7 +114,7 @@
 
 	teams = Sort_Spawn();
 	players = Sort_Spawn();
-	
+
 	GetTeam(COLOR_SPECTATOR, true); // add specs first
 
 	cvar_clientsettemp("_supports_weaponpriority", "1");
@@ -292,7 +292,7 @@
 	// Tokenize String
 	//argc = tokenize(strMessage);
 	argc = tokenize_sane(strMessage);
-	
+
 	// Acquire Command
 	local string strCmd;
 	strCmd = argv(0);
@@ -498,7 +498,7 @@
 	{
 		print("Invalid command. For a list of supported commands, try cl_cmd help.\n");
 	}
-	
+
 	return;
 }
 
@@ -512,7 +512,7 @@
 {
 	local float bSkipKey;
 	bSkipKey = false;
-	
+
 	if(menu_visible)
 		if(menu_action(bInputType, nPrimary, nSecondary))
 			return TRUE;
@@ -605,7 +605,7 @@
 
 	if(o.sort_prev)
 		Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
-	
+
 	self.entremove = Ent_RemovePlayerScore;
 }
 
@@ -613,7 +613,7 @@
 {
 	float i;
 	entity o;
-	
+
 	self.team = ReadByte();
 	o = self.owner = GetTeam(self.team, true);
 
@@ -669,7 +669,7 @@
 	}
 	else
 		angles_held_status = 0;
-	
+
 	if(newspectatee_status != spectatee_status)
 	{
 		// clear race stuff
@@ -779,7 +779,7 @@
 			error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
 			break;
 	}
-	
+
 	time = savetime;
 };
 // Destructor, but does NOT deallocate the entity by calling remove(). Also
@@ -829,7 +829,7 @@
 	print(ColorTranslateRGB(strMessage));
 }
 
-// CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided.  
+// CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided.
 void CSQC_Parse_CenterPrint(string strMessage)
 {
 	centerprint(strMessage);
@@ -1019,12 +1019,16 @@
 			Net_ReadNexgunBeamParticle();
 			bHandled = true;
 			break;
+        case TE_CSQC_LIGHTNINGARC:
+            Net_ReadLightningarc();
+            bHandled = true;
+            break;
 		default:
 			// No special logic for this temporary entity; return 0 so the engine can handle it
 			bHandled = false;
 			break;
 	}
-		
+
 	return bHandled;
 }
 
@@ -1053,13 +1057,13 @@
 	keys = db_get(binddb, command);
 	if(csqc_flags & CSQC_FLAG_READPICTURE)
 	{
-		if (!keys) 
+		if (!keys)
 		{
 			n = tokenize_insane(findkeysforcommand(command)); // uses '...' strings
 			for(j = 0; j < n; ++j)
 			{
 				k = stof(argv(j));
-				if(k != -1) 
+				if(k != -1)
 				{
 					if ("" == keys)
 						keys = keynumtostring(k);
@@ -1069,12 +1073,12 @@
 					++l;
 					if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
 				}
-			
+
 			}
 			db_put(binddb, command, keys);
 		}
 	}
-	
+
 	if ("" == keys) {
 		if (sbar_showbinds > 1)
 			return strcat(text, " (not bound)");

Copied: branches/nexuiz-2.0/data/qcsrc/client/effects.qc (from rev 6332, trunk/data/qcsrc/client/effects.qc)
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/effects.qc	                        (rev 0)
+++ branches/nexuiz-2.0/data/qcsrc/client/effects.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -0,0 +1,100 @@
+/*
+.vector fx_start;
+.vector fx_end;
+.float  fx_with;
+.string fx_texture;
+.float  fx_lifetime;
+
+void SUB_Remove()
+{ remove(self); }
+
+void b_draw()
+{
+    //Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, 0, time * 3, '1 1 1', 0.7, DRAWFLAG_ADDITIVE);
+    Draw_CylindricLine(self.fx_start, self.fx_end, self.fx_with, self.fx_texture, (self.fx_with/256), 0, '1 1 1', 1, DRAWFLAG_ADDITIVE);
+
+}
+void b_make(vector s,vector e, string t,float l,float z)
+{
+    entity b;
+    b = spawn();
+    b.fx_texture = t;
+    b.fx_start = s;
+    b.fx_end = e;
+    b.fx_with = z;
+    b.think = SUB_Remove;
+    b.nextthink = time + l;
+	b.draw = b_draw;
+
+	//b.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
+}
+*/
+
+void cl_effetcs_lightningarc(vector from, vector to,float seglength,float drifts,float drifte,float branchfactor,float branchfactor_add)
+{
+    vector direction,dirnew, pos, pos_l;
+    float length, steps, steplength, i,drift;
+
+    length     = vlen(from - to);
+    if(length < 1)
+        return;
+
+    steps      = floor(length / seglength);
+    if(steps < 1)
+    {
+        te_lightning1(world,from,to);
+        return;
+    }
+
+    steplength = length / steps;
+    direction  = normalize(to - from);
+    pos_l = from;
+    if(length > seglength)
+    {
+        for(i = 1; i < steps; i += 1)
+        {
+            drift = drifts * (1 - (i / steps)) + drifte * (i / steps);
+            dirnew = normalize(direction * (1 - drift) + randomvec() * drift);
+            pos = pos_l +  dirnew * steplength;
+            te_lightning1(world,pos_l,pos);
+            //b_make(pos_l, pos,"particles/lightning2",0.25,64);
+            if(random() < branchfactor)
+                cl_effetcs_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add);
+
+            pos_l = pos;
+        }
+        te_lightning1(world,pos_l,to);
+        //b_make(pos_l, to,"particles/lightning2",0.25,64);
+
+    }
+    else
+        te_lightning1(world,from,to);
+        //b_make(from, to,"particles/lightning2",0.25,64);
+
+}
+
+void Net_ReadLightningarc()
+{
+	vector from, to;
+
+    from_x = ReadCoord(); from_y = ReadCoord(); from_z = ReadCoord();
+    to_x   = ReadCoord(); to_y   = ReadCoord(); to_z   = ReadCoord();
+
+    if(cvar("cl_effects_lightningarc_simple"))
+    {
+        te_lightning1(world,from,to);
+    }
+    else
+    {
+        float seglength, drifts, drifte, branchfactor, branchfactor_add;
+
+        seglength    = cvar("cl_effects_lightningarc_segmentlength");
+        drifts       = cvar("cl_effects_lightningarc_drift_start");
+        drifte       = cvar("cl_effects_lightningarc_drift_end");
+        branchfactor = cvar("cl_effects_lightningarc_branchfactor_start");
+        branchfactor = cvar("cl_effects_lightningarc_branchfactor_add");
+
+        cl_effetcs_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
+    }
+
+}

Modified: branches/nexuiz-2.0/data/qcsrc/client/progs.src
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/progs.src	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/client/progs.src	2009-03-27 18:16:42 UTC (rev 6333)
@@ -34,6 +34,7 @@
 gibs.qc
 damage.qc
 casings.qc
+effects.qc
 
 Main.qc
 View.qc

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1967,7 +1967,16 @@
 				}
 
 				// ammo
-				x = getstati(STAT_AMMO);
+				if (stat_items & IT_SHELLS)
+					x = getstati(STAT_SHELLS);
+				else if (stat_items & IT_NAILS)
+					x = getstati(STAT_NAILS);
+				else if (stat_items & IT_ROCKETS)
+					x = getstati(STAT_ROCKETS);
+				else if (stat_items & IT_CELLS)
+					x = getstati(STAT_CELLS);
+				else
+					x = 0;
 				if ((stat_items & IT_AMMO) || x != 0)
 				{
 					if (stat_items & IT_SHELLS)
@@ -1984,6 +1993,18 @@
 						Sbar_DrawXNum('224 0 0', x, 3, 24, '0.7 0 0', 1, 0);
 				}
 
+				// jetpack cells
+				if(stat_items & IT_USING_JETPACK)
+				if not(stat_items & IT_CELLS)
+				{
+					x = getstati(STAT_CELLS);
+					drawpic(sbar + '296 -30 0', "gfx/sb_cells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
+					if(x > 10)
+						Sbar_DrawXNum('224 -30 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
+					else
+						Sbar_DrawXNum('224 -30 0', x, 3, 24, '0.7 0 0', 1, 0);
+				}
+
 				if (sbar_x + 320 + 160 <= vid_conwidth)
 					Sbar_MiniDeathmatchOverlay(sbar + '320 0 0');
 				if (sbar_x > 0)
@@ -2034,7 +2055,16 @@
 				else
 					Sbar_DrawXNum('81 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
 
-				x = getstati(STAT_AMMO);
+				if (stat_items & IT_SHELLS)
+					x = getstati(STAT_SHELLS);
+				else if (stat_items & IT_NAILS)
+					x = getstati(STAT_NAILS);
+				else if (stat_items & IT_ROCKETS)
+					x = getstati(STAT_ROCKETS);
+				else if (stat_items & IT_CELLS)
+					x = getstati(STAT_CELLS);
+				else
+					x = 0;
 				if ((stat_items & IT_AMMO) || x != 0)
 				{
 					// (519-3*24) = 447
@@ -2052,6 +2082,18 @@
 						Sbar_DrawXNum('447 12 0', x, 3, 24, '0.7 0 0', 1, 0);
 				}
 
+				// jetpack cells
+				if(stat_items & IT_USING_JETPACK)
+				if not(stat_items & IT_CELLS)
+				{
+					x = getstati(STAT_CELLS);
+					drawpic(sbar + '519 -40 0', "gfx/sb_cells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
+					if(x > 10)
+						Sbar_DrawXNum('447 -28 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
+					else
+						Sbar_DrawXNum('447 -28 0', x, 3, 24, '0.7 0 0', 1, 0);
+				}
+
 				if (sb_lines > 24)
 					drawpic(sbar, "gfx/sbar_overlay", '0 0 0', '1 1 1', 1, DRAWFLAG_MODULATE);
 

Modified: branches/nexuiz-2.0/data/qcsrc/common/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2009-03-27 18:16:42 UTC (rev 6333)
@@ -46,7 +46,8 @@
 const float TE_CSQC_RACE = 101;
 const float TE_CSQC_SPAWN = 102;
 const float TE_CSQC_ZCURVEPARTICLES = 103;
-const float TE_CSQC_NEXGUNBEAMPARTICLE = 104;
+const float TE_CSQC_NEXGUNBEAMPARTICLE = 104;
+const float TE_CSQC_LIGHTNINGARC = 105;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;

Modified: branches/nexuiz-2.0/data/qcsrc/common/items.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/items.qh	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/common/items.qh	2009-03-27 18:16:42 UTC (rev 6333)
@@ -30,6 +30,8 @@
 float	IT_UNLIMITED_AMMO         = 3;
 // both of these combined
 float	IT_CTF_SHIELDED           = 4; // set for the flag shield
+// using jetpack
+float   IT_USING_JETPACK          = 8;
 float	IT_SHELLS				= 256;
 float	IT_NAILS				= 512;
 float	IT_ROCKETS				= 1024;

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_multiplayer_create_mutators.c	2009-03-27 18:16:42 UTC (rev 6333)
@@ -90,6 +90,8 @@
 		s = strcat(s, ", Weapons stay");
 	if(cvar("g_bloodloss") > 0)
 		s = strcat(s, ", Bloodloss");
+	if(cvar("g_jetpack"))
+		s = strcat(s, ", Jet pack");
 	if(s == "")
 		return "None";
 	else
@@ -173,7 +175,7 @@
 	me.TR(me);
 		me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_pinata", "Pinata"));
 	me.TR(me);
-		me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_weapon_stay", "Weapons stay"));
+		me.TD(me, 1, 2, e = makeNexuizCheckBoxEx(2, 0, "g_weapon_stay", "Weapons stay"));
 	me.TR(me);
 		s = makeNexuizSlider(10, 50, 1, "g_bloodloss");
 		me.TD(me, 1, 2, e = makeNexuizSliderCheckBox(0, 1, s, "Blood loss"));
@@ -181,6 +183,8 @@
 		me.TDempty(me, 0.2);
 		me.TD(me, 1, 1.8, s);
 	me.TR(me);
+		me.TD(me, 1, 2, e = makeNexuizCheckBox(0, "g_jetpack", "Jet pack"));
+	me.TR(me);
 		s = makeNexuizSlider(80, 400, 8, "sv_gravity");
 			s.valueDigits = 0;
 			s.valueDisplayMultiplier = 0.125; // show gravity in percent

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_effects.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_effects.c	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_effects.c	2009-03-27 18:16:42 UTC (rev 6333)
@@ -139,8 +139,7 @@
 
 	me.TR(me);
 		if(cvar("developer"))
-			me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "r_showsurfaces", "Show surfaces"));
-				e.yesValue = 3;
+			me.TD(me, 1, 3, e = makeNexuizCheckBoxEx(3, 0, "r_showsurfaces", "Show surfaces"));
 
 	me.TR(me);
 		me.TD(me, 1, 1.5, e = makeNexuizCheckBox(0, "r_glsl_offsetmapping", "Offset mapping"));

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	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_input.c	2009-03-27 18:16:42 UTC (rev 6333)
@@ -72,8 +72,6 @@
 			e.addValue(e, "Long", "2");
 			e.configureNexuizTextSliderValues(e);
 	me.TR(me);
-		me.TD(me, 1, 3, e = makeNexuizCheckBox(0, "cl_showpressedkeys", "Show pressed keys"));
-			e.noValue = 0;
-			e.yesValue = 2;
+		me.TD(me, 1, 3, e = makeNexuizCheckBoxEx(2, 0, "cl_showpressedkeys", "Show pressed keys"));
 }
 #endif

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_misc.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_misc.c	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/dialog_settings_misc.c	2009-03-27 18:16:42 UTC (rev 6333)
@@ -52,9 +52,7 @@
 		me.TD(me, 1, 2.8/3, e = makeNexuizRadioButton(1, "showspeed", "5", "knots"));
 	me.TR(me);
 		me.TDempty(me, 0.2);
-		me.TD(me, 1, 2.8, e = makeNexuizCheckBox(0, "showtopspeed", "Also show top speed"));
-			e.yesValue = -1;
-			e.noValue = 0;
+		me.TD(me, 1, 2.8, e = makeNexuizCheckBoxEx(-1, 0, "showtopspeed", "Also show top speed"));
 			setDependent(e, "showspeed", 0.5, -0.5);
 	me.TR(me);
 	me.TR(me);

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/util.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/util.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/util.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -269,11 +269,15 @@
 void preMenuDraw()
 {
 	vector fs, sz, line, mid;
-	Item_Nex_ExtResponseSystem_CheckForResponse();
-	if(!_Nex_ExtResponseSystem_VersionHandled)
-		if(time > _Nex_ExtResponseSystem_RetryTime)
-			Item_Nex_ExtResponseSystem_SendQuery();
 
+	if(!cvar("menu_updatecheck"))
+	{
+		Item_Nex_ExtResponseSystem_CheckForResponse();
+		if(!_Nex_ExtResponseSystem_VersionHandled)
+			if(time > _Nex_ExtResponseSystem_RetryTime)
+				Item_Nex_ExtResponseSystem_SendQuery();
+	}
+
 	if(_Nex_ExtResponseSystem_UpdateTo != "")
 	{
 		fs = ((1/draw_scale_x) * eX + (1/draw_scale_y) * eY) * 12;

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1341,6 +1341,8 @@
 
 	if(!sv_foginterval && world.fog != "")
 		stuffcmd(self, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
+
+	SoundEntity_Attach(self);
 }
 
 /*
@@ -1370,6 +1372,8 @@
 		GameLogEcho(strcat(":part:", ftos(self.playerid)));
 	bprint ("^4",self.netname);
 	bprint ("^4 disconnected\n");
+	
+	SoundEntity_Detach(self);
 
 	DropAllRunes(self);
 	kh_Key_DropAll(self, TRUE);
@@ -1574,6 +1578,22 @@
 
 void player_powerups (void)
 {
+	if((self.items & IT_USING_JETPACK) && !self.deadflag)
+	{
+		SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, ATTN_IDLE);
+		self.modelflags |= MF_ROCKET;
+	}
+	else
+	{
+		SoundEntity_StopSound(self, CHAN_PLAYER);
+		self.modelflags &~= MF_ROCKET;
+	}
+
+	self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
+
+	if(!self.modelindex || self.deadflag) // don't apply the flags if the player is gibbed
+		return;
+
 	if (g_minstagib)
 	{
 		if (self.items & IT_STRENGTH)
@@ -1616,11 +1636,6 @@
 		return;
 	}
 
-	self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
-
-	if(!self.modelindex) // don't apply the flags if the player is gibbed
-		return;
-
 	if (self.items & IT_STRENGTH)
 	{
 		self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
@@ -1829,7 +1844,10 @@
 void SpectateCopy(entity spectatee) {
 	self.armortype = spectatee.armortype;
 	self.armorvalue = spectatee.armorvalue;
-	self.currentammo = spectatee.currentammo;
+	self.ammo_cells = spectatee.ammo_cells;
+	self.ammo_shells = spectatee.ammo_shells;
+	self.ammo_nails = spectatee.ammo_nails;
+	self.ammo_rockets = spectatee.ammo_rockets;
 	self.effects = spectatee.effects & EFMASK_CHEAP; // eat performance
 	self.health = spectatee.health;
 	self.impulse = 0;
@@ -2193,6 +2211,8 @@
 			self.fixangle = TRUE;
 		}
 
+		player_powerups();
+
 		if (self.deadflag != DEAD_NO)
 		{
 			float button_pressed, force_respawn;
@@ -2319,7 +2339,6 @@
 		if(frametime)
 			W_WeaponFrame();
 
-		player_powerups();
 		player_regen();
 		if(frametime)
 			player_anim();

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_physics.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -356,6 +356,7 @@
 	local vector wishvel, wishdir, v;
 	local float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, shtest_score, buttons;
 	string temps;
+	float buttons_prev;
 
 	buttons = self.BUTTON_ATCK + 2 * self.BUTTON_JUMP + 4 * self.BUTTON_ATCK2 + 8 * self.BUTTON_ZOOM + 16 * self.BUTTON_CROUCH + 32 * self.BUTTON_HOOK + 64 * self.BUTTON_USE;
 	if(!sv_maxidle_spectatorsareidle || self.movetype == MOVETYPE_WALK)
@@ -363,6 +364,7 @@
 		if(buttons != self.buttons_old || self.movement != self.movement_old || self.v_angle != self.v_angle_old)
 			self.parm_idlesince = time;
 	}
+	buttons_prev = self.buttons_old;
 	self.buttons_old = buttons;
 	self.movement_old = self.movement;
 	self.v_angle_old = self.v_angle;
@@ -388,6 +390,8 @@
 	if (clienttype(self) == CLIENTTYPE_BOT)
 		bot_think();
 
+	self.items &~= IT_USING_JETPACK;
+
 	if (self.movetype == MOVETYPE_NONE && self.disableclientprediction != 2)
 		return;
 
@@ -476,7 +480,7 @@
 
 	// if dead, behave differently
 	if (self.deadflag)
-		return;
+		goto end;
 
 	if (!self.fixangle && !g_bugrigs)
 	{
@@ -634,8 +638,63 @@
 				self.velocity = self.velocity + wishdir * min(f, sv_accelerate*maxspd_mod * frametime * wishspeed);
 		}
 	}
+	else if (g_jetpack && self.BUTTON_HOOK && (!cvar("g_jetpack_ammo") || self.ammo_cells >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
+	{
+		//makevectors(self.v_angle_y * '0 1 0');
+		makevectors(self.v_angle);
+		wishvel = v_forward * self.movement_x + v_right * self.movement_y;
+		// add remaining speed as Z component
+		maxairspd = sv_maxairspeed*max(1, maxspd_mod);
+		// fix speedhacks :P
+		wishvel = normalize(wishvel) * min(vlen(wishvel) / maxairspd, 1);
+		// add the unused velocity as up component
+		wishvel_z = 0;
+		wishvel_z = sqrt(max(0, 1 - wishvel * wishvel));
+		// it is now normalized, so...
+		wishvel_x *= cvar("g_jetpack_acceleration_side");
+		wishvel_y *= cvar("g_jetpack_acceleration_side");
+		wishvel_z *= cvar("g_jetpack_acceleration_up");
+		wishvel_z += cvar("g_jetpack_antigravity") * sv_gravity;
+
+		float fxy, fz;
+		fxy = bound(0, 1 - (self.velocity * normalize(wishvel_x * '1 0 0' + wishvel_y * '0 1 0')) / cvar("g_jetpack_maxspeed_side"), 1);
+		if(wishvel_z - sv_gravity > 0)
+			fz = bound(0, 1 - self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
+		else
+			fz = bound(0, 1 + self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
+
+		float fvel;
+		fvel = vlen(wishvel);
+		wishvel_x *= fxy;
+		wishvel_y *= fxy;
+		wishvel_z = (wishvel_z - sv_gravity) * fz + sv_gravity;
+		fvel = min(1, vlen(wishvel) / fvel);
+
+		if(cvar("g_jetpack_ammo") && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
+		{
+			if(self.ammo_cells < 0.01)
+				f = 0;
+			else
+				f = min(1, self.ammo_cells / (cvar("g_jetpack_ammo") * frametime * fvel));
+		}
+		else
+			f = 1;
+
+		if (f > 0 && wishvel != '0 0 0')
+		{
+			self.velocity = self.velocity + wishvel * f * frametime;
+			if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+				self.ammo_cells -= cvar("g_jetpack_ammo") * frametime * fvel * f;
+			self.flags &~= FL_ONGROUND;
+			self.items |= IT_USING_JETPACK;
+		}
+	}
 	else if (self.flags & FL_ONGROUND)
 	{
+		// we get here if we ran out of ammo
+		if(g_jetpack && self.BUTTON_HOOK && !(buttons_prev & 32))
+			sprint(self, "You don't have any fuel for the ^2Jetpack\n");
+
 		// walking
 		makevectors(self.v_angle_y * '0 1 0');
 		wishvel = v_forward * self.movement_x + v_right * self.movement_y;
@@ -682,6 +741,10 @@
 	}
 	else
 	{
+		// we get here if we ran out of ammo
+		if(g_jetpack && self.BUTTON_HOOK && !(buttons_prev & 32))
+			sprint(self, "You don't have any fuel for the ^2Jetpack\n");
+
 		if(maxspd_mod < 1)
 		{
 			maxairspd = sv_maxairspeed*maxspd_mod;
@@ -734,6 +797,7 @@
 		}
 	}
 
+:end
 	if(self.flags & FL_ONGROUND)
 		self.lastground = time;
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -368,6 +368,7 @@
 	//	self.weapon_nextthink = time;
 
 	// update currentammo incase it has changed
+#if 0
 	if (self.items & IT_CELLS)
 		self.currentammo = self.ammo_cells;
 	else if (self.items & IT_ROCKETS)
@@ -378,7 +379,7 @@
 		self.currentammo = self.ammo_shells;
 	else
 		self.currentammo = 1;
-
+#endif
 };
 
 float nixnex_weapon;

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,4 +1,4 @@
-string CVAR_CHECK_DEFAULT = "536ebc4385079e467b5b49c21ff625e5";
+string CVAR_CHECK_DEFAULT = "c57e95e5c45c75494b2b35e5edaad80c";
 string CVAR_CHECK_WEAPONS = "6dd73b6c78519153d50f876be23bfe77";
 
 float	FALSE					= 0;

Copied: branches/nexuiz-2.0/data/qcsrc/server/csqceffects.qc (from rev 6332, trunk/data/qcsrc/server/csqceffects.qc)
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/csqceffects.qc	                        (rev 0)
+++ branches/nexuiz-2.0/data/qcsrc/server/csqceffects.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -0,0 +1,13 @@
+void te_csqc_lightningarc(vector from,vector to)
+{
+	WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+	WriteByte(MSG_BROADCAST, TE_CSQC_LIGHTNINGARC);
+
+	WriteCoord(MSG_BROADCAST, from_x);
+	WriteCoord(MSG_BROADCAST, from_y);
+	WriteCoord(MSG_BROADCAST, from_z);
+	WriteCoord(MSG_BROADCAST, to_x);
+	WriteCoord(MSG_BROADCAST, to_y);
+	WriteCoord(MSG_BROADCAST, to_z);
+}
+

Modified: branches/nexuiz-2.0/data/qcsrc/server/defs.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2009-03-27 18:16:42 UTC (rev 6333)
@@ -36,6 +36,7 @@
 float g_pickup_respawntime_long;
 float g_pickup_respawntime_powerup;
 float g_maplist_allow_hidden;
+float g_jetpack;
 
 float sv_clones;
 float sv_cheats;
@@ -554,3 +555,5 @@
 float servertime, serverprevtime, serverframetime;
 
 void Drag_MoveDrag(entity from, entity to);
+
+.entity soundentity;

Modified: branches/nexuiz-2.0/data/qcsrc/server/domination.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/domination.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/domination.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -19,6 +19,7 @@
 
 .float enemy_playerid;
 .entity sprite;
+.float captime;
 
 void() dom_controlpoint_setup;
 
@@ -111,6 +112,8 @@
 	}
 	WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
 	WaypointSprite_Ping(self.sprite);
+
+	self.captime = time;
 };
 
 void AnimateDomPoint()
@@ -176,6 +179,9 @@
 		return;
 	if (other.health < 1)
 		return;
+	
+	if(time < self.captime + 0.3)
+		return;
 
 	// only valid teams can claim it
 	head = find(world, classname, "dom_team");

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_hook.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -408,7 +408,7 @@
 			//self.hook_state &~= HOOK_RELEASING;
 		}
 	}
-	else if(!g_grappling_hook && self.switchweapon != WEP_HOOK)
+	else if(!g_jetpack && !g_grappling_hook && self.switchweapon != WEP_HOOK)
 	{
 		if(self.BUTTON_HOOK && !self.hook_switchweapon)
 			W_SwitchWeapon(WEP_HOOK);

Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -947,16 +947,26 @@
 		g_grappling_hook = 0;
 	}
 
+	if(g_jetpack)
+	{
+		if(!start_ammo_cells)
+			start_ammo_cells = g_pickup_cells;
+		if(!warmup_start_ammo_cells)
+			warmup_start_ammo_cells = g_pickup_cells;
+
+		g_grappling_hook = 0; // these two can't coexist, as they use the same button
+	}
+
 	if(g_weapon_stay == 2)
 	{
 		if(!start_ammo_shells) start_ammo_shells = g_pickup_shells;
-		if(!start_ammo_nails) start_ammo_shells = g_pickup_nails;
-		if(!start_ammo_cells) start_ammo_shells = g_pickup_cells;
-		if(!start_ammo_rockets) start_ammo_shells = g_pickup_rockets;
+		if(!start_ammo_nails) start_ammo_nails = g_pickup_nails;
+		if(!start_ammo_cells) start_ammo_cells = g_pickup_cells;
+		if(!start_ammo_rockets) start_ammo_rockets = g_pickup_rockets;
 		if(!warmup_start_ammo_shells) warmup_start_ammo_shells = g_pickup_shells;
-		if(!warmup_start_ammo_nails) warmup_start_ammo_shells = g_pickup_nails;
-		if(!warmup_start_ammo_cells) warmup_start_ammo_shells = g_pickup_cells;
-		if(!warmup_start_ammo_rockets) warmup_start_ammo_shells = g_pickup_rockets;
+		if(!warmup_start_ammo_nails) warmup_start_ammo_nails = g_pickup_nails;
+		if(!warmup_start_ammo_cells) warmup_start_ammo_cells = g_pickup_cells;
+		if(!warmup_start_ammo_rockets) warmup_start_ammo_rockets = g_pickup_rockets;
 	}
 
 	start_ammo_shells = max(0, start_ammo_shells);
@@ -1024,6 +1034,7 @@
 	g_jump_grunt = cvar("g_jump_grunt");
 	g_footsteps = cvar("g_footsteps");
 	g_grappling_hook = cvar("g_grappling_hook");
+	g_jetpack = cvar("g_jetpack");
 	g_laserguided_missile = cvar("g_laserguided_missile");
 	g_midair = cvar("g_midair");
 	g_minstagib = cvar("g_minstagib");
@@ -1373,6 +1384,9 @@
 	precache_sound ("misc/teleport.wav");
 	precache_sound ("player/lava.wav");
 	precache_sound ("player/slime.wav");
+	
+	if(g_jetpack)
+		precache_sound ("misc/jetpack_fly.wav");
 
 	// announcer sounds - male
 	precache_sound ("announcer/male/electrobitch.wav");
@@ -1427,7 +1441,7 @@
 	// common weapon precaches
 	precache_sound ("weapons/weapon_switch.wav");
 	precache_sound ("weapons/weaponpickup.wav");
-	if (cvar("g_grappling_hook"))
+	if(g_grappling_hook)
 	{
 		precache_sound ("weapons/hook_fire.wav"); // hook
 		precache_sound ("weapons/hook_impact.wav"); // hook
@@ -2130,3 +2144,39 @@
 	gettaginfo_relative_ent.frame = e.frame;
 	return gettaginfo(gettaginfo_relative_ent, tag);
 }
+
+void SoundEntity_StartSound(entity pl, float chan, string samp, float vol, float attn)
+{
+	float p;
+	p = pow(2, chan);
+	if(pl.soundentity.cnt & p)
+		return;
+	soundtoat(MSG_ALL, pl.soundentity, gettaginfo(pl.soundentity, 0), chan, samp, vol, attn);
+	pl.soundentity.cnt |= p;
+}
+
+void SoundEntity_StopSound(entity pl, float chan)
+{
+	float p;
+	p = pow(2, chan);
+	if(pl.soundentity.cnt & p)
+	{
+		stopsoundto(MSG_ALL, pl.soundentity, chan);
+		pl.soundentity.cnt &~= p;
+	}
+}
+
+void SoundEntity_Attach(entity pl)
+{
+	pl.soundentity = spawn();
+	pl.soundentity.classname = "soundentity";
+	setattachment(pl.soundentity, pl, "");
+	setmodel(pl.soundentity, "null");
+}
+
+void SoundEntity_Detach(entity pl)
+{
+	float i;
+	for(i = 0; i <= 7; ++i)
+		SoundEntity_StopSound(pl, i);
+}

Modified: branches/nexuiz-2.0/data/qcsrc/server/movelib.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/movelib.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/movelib.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,102 +1,104 @@
-/**
-    Simulate drag
-    self.velocity = movelib_vdrag(self.velocity,0.02,0.5);
-**/
-vector movelib_dragvec(float drag, float exp)
-{
-    float lspeed,ldrag;
-
-    lspeed = vlen(self.velocity);
-    ldrag = lspeed * drag;
-    ldrag = ldrag * (drag * exp);
-    ldrag = 1 - (ldrag / lspeed);
-
-    return self.velocity * ldrag;
-}
-
-/**
-    Simulate drag
-    self.velocity = movelib_vdrag(somespeed,0.01,0.7);
-**/
-float movelib_dragflt(float fspeed,float drag,float exp)
-{
-    float ldrag;
-
-    ldrag = fspeed * drag;
-    ldrag = ldrag * ldrag * exp;
-    ldrag = 1 - (ldrag / fspeed);
-
-    return ldrag;
-}
-
-/**
-    Do a inertia simulation based on velocity.
-    Basicaly, this allows you to simulate loss of steering with higher speed.
-    self.velocity = movelib_inertia_fromspeed(self.velocity,newvel,1000,0.1,0.9);
-**/
-vector movelib_inertmove_byspeed(vector vel_new, float vel_max,float newmin,float oldmax)
-{
-    float influense;
-
-    influense = vlen(self.velocity) * (1 / vel_max);
-
-    influense = bound(newmin,influense,oldmax);
-
-    return (vel_new * (1 - influense)) + (self.velocity * influense);
-}
-
-vector movelib_inertmove(vector new_vel,float new_bias)
-{
-    return new_vel * new_bias + self.velocity * (1-new_bias);
-}
-
-.float  movelib_lastupdate;
-void movelib_move(vector force,float max_velocity,float drag,float mass,float breakforce)
-{
-    float deltatime;
-    float acceleration;
+.vector moveto;
+
+/**
+    Simulate drag
+    self.velocity = movelib_vdrag(self.velocity,0.02,0.5);
+**/
+vector movelib_dragvec(float drag, float exp)
+{
+    float lspeed,ldrag;
+
+    lspeed = vlen(self.velocity);
+    ldrag = lspeed * drag;
+    ldrag = ldrag * (drag * exp);
+    ldrag = 1 - (ldrag / lspeed);
+
+    return self.velocity * ldrag;
+}
+
+/**
+    Simulate drag
+    self.velocity = movelib_vdrag(somespeed,0.01,0.7);
+**/
+float movelib_dragflt(float fspeed,float drag,float exp)
+{
+    float ldrag;
+
+    ldrag = fspeed * drag;
+    ldrag = ldrag * ldrag * exp;
+    ldrag = 1 - (ldrag / fspeed);
+
+    return ldrag;
+}
+
+/**
+    Do a inertia simulation based on velocity.
+    Basicaly, this allows you to simulate loss of steering with higher speed.
+    self.velocity = movelib_inertia_fromspeed(self.velocity,newvel,1000,0.1,0.9);
+**/
+vector movelib_inertmove_byspeed(vector vel_new, float vel_max,float newmin,float oldmax)
+{
+    float influense;
+
+    influense = vlen(self.velocity) * (1 / vel_max);
+
+    influense = bound(newmin,influense,oldmax);
+
+    return (vel_new * (1 - influense)) + (self.velocity * influense);
+}
+
+vector movelib_inertmove(vector new_vel,float new_bias)
+{
+    return new_vel * new_bias + self.velocity * (1-new_bias);
+}
+
+.float  movelib_lastupdate;
+void movelib_move(vector force,float max_velocity,float drag,float mass,float breakforce)
+{
+    float deltatime;
+    float acceleration;
     float mspeed;
-    vector breakvec;
-
-    deltatime = time - self.movelib_lastupdate;
-    if (deltatime > 0.15) deltatime = 0;
-    self.movelib_lastupdate = time;
-    if(!deltatime) return;
-
-    mspeed = vlen(self.velocity);
-
-    if(mass)
-        acceleration = vlen(force) / mass;
-    else
-        acceleration = vlen(force);
-
-    if(self.flags & FL_ONGROUND)
-    {
-        if(breakforce)
+    vector breakvec;
+
+    deltatime = time - self.movelib_lastupdate;
+    if (deltatime > 0.15) deltatime = 0;
+    self.movelib_lastupdate = time;
+    if (!deltatime) return;
+
+    mspeed = vlen(self.velocity);
+
+    if (mass)
+        acceleration = vlen(force) / mass;
+    else
+        acceleration = vlen(force);
+
+    if (self.flags & FL_ONGROUND)
+    {
+        if (breakforce)
         {
             breakvec = (normalize(self.velocity) * (breakforce / mass) * deltatime);
-            self.velocity = self.velocity - breakvec;
+            self.velocity = self.velocity - breakvec;
         }
-
-        self.velocity = self.velocity + force * (acceleration * deltatime);
+
+        self.velocity = self.velocity + force * (acceleration * deltatime);
     }
-
-    if(drag)
+
+    if (drag)
         self.velocity = movelib_dragvec(drag, 1);
 
-    if(self.waterlevel > 1)
+    if (self.waterlevel > 1)
     {
         self.velocity = self.velocity + force * (acceleration * deltatime);
         self.velocity = self.velocity + '0 0 0.05' * sv_gravity * deltatime;
     }
-    else
-        self.velocity = self.velocity + '0 0 -1' * sv_gravity * deltatime;
+    else
+        self.velocity = self.velocity + '0 0 -1' * sv_gravity * deltatime;
 
-    mspeed = vlen(self.velocity);
-
-    if(max_velocity)
-        if(mspeed > max_velocity)
-            self.velocity = normalize(self.velocity) * (mspeed - 50);//* max_velocity;
+    mspeed = vlen(self.velocity);
+
+    if (max_velocity)
+        if (mspeed > max_velocity)
+            self.velocity = normalize(self.velocity) * (mspeed - 50);//* max_velocity;
 }
 
 /*
@@ -117,7 +119,7 @@
 
     self.movelib_lastupdate = time;
 }
-
+
 void movelib_update(vector dir,float force)
 {
     vector acceleration;
@@ -158,11 +160,11 @@
 
 }
 */
-
-void movelib_move_simple(vector newdir,float velo,float blendrate)
-{
-    self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo;
-}
+
+void movelib_move_simple(vector newdir,float velo,float blendrate)
+{
+    self.velocity = self.velocity * (1 - blendrate) + (newdir * blendrate) * velo;
+}
 void movelib_beak_simple(float force)
 {
     float mspeed;
@@ -176,28 +178,37 @@
 
 void movelib_groundalign4point(float spring_length,float spring_up)
 {
-    vector a,b,c,d,e,r,push_angle;
+    vector a,b,c,d,e,r,push_angle, ahead,side;
+
     push_angle_y = 0;
     r = (self.absmax + self.absmin) * 0.5 + (v_up * spring_up);
     e = v_up * spring_length;
 
-    a = r + (v_forward * self.maxs_x) + (v_right * self.maxs_y);
-    b = r + (v_forward * self.maxs_x) - (v_right * self.maxs_y);
-    c = r - (v_forward * self.maxs_x) + (v_right * self.maxs_y);
-    d = r - (v_forward * self.maxs_x) - (v_right * self.maxs_y);
+    // Put springs slightly inside bbox
+    ahead = v_forward * (self.maxs_x * 0.85);
+    side  = v_right   * (self.maxs_y * 0.85);
 
+    a = r + ahead + side;
+    b = r + ahead - side;
+    c = r - ahead + side;
+    d = r - ahead - side;
+
     traceline(a, a - e,MOVE_NORMAL,self);
     a_z =  (1 - trace_fraction);
     r = trace_endpos;
+
     traceline(b, b - e,MOVE_NORMAL,self);
     b_z =  (1 - trace_fraction);
     r += trace_endpos;
+
     traceline(c, c - e,MOVE_NORMAL,self);
     c_z =  (1 - trace_fraction);
     r += trace_endpos;
+
     traceline(d, d - e,MOVE_NORMAL,self);
     d_z =  (1 - trace_fraction);
     r += trace_endpos;
+
     a_x = r_z;
     r = self.origin;
     r_z = r_z;

Modified: branches/nexuiz-2.0/data/qcsrc/server/pathlib.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/pathlib.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/pathlib.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -7,6 +7,10 @@
     .entity path_prev;
 #endif
 
+#define medium spawnshieldtime
+
+//#define DEBUGPATHING
+
 entity openlist;
 entity closedlist;
 entity scraplist;
@@ -22,6 +26,10 @@
 float pathlib_recycle_cnt;
 float pathlib_searched_cnt;
 
+#ifdef DEBUGPATHING
+
+#endif
+
 float pathlib_bestopen_seached;
 float pathlib_bestcash_hits;
 float pathlib_bestcash_saved;
@@ -41,16 +49,12 @@
 .float is_path_node;
 
 
-
-#define DEBUGPATHING
 #ifdef DEBUGPATHING
 float edge_show(vector point,float fsize);
 void mark_error(vector where,float lifetime);
 void mark_info(vector where,float lifetime);
 entity mark_misc(vector where,float lifetime);
 
-
-
 void pathlib_showpath(entity start)
 {
     entity e;
@@ -91,19 +95,6 @@
 
 #endif
 
-/*
-float pathlib_stdproc_path_validate(vector start,vector end)
-{
-    tracebox(start, self.mins * 2, self.maxs * 2, end, MOVE_WORLDONLY, self);
-
-    if(vlen(trace_endpos - end) < 5)
-        return 1;
-
-    return 0;
-}
-*/
-
-
 void pathlib_deletepath(entity start)
 {
     entity e;
@@ -133,16 +124,13 @@
     return vret;
 }
 
-
-#define floor_failmask (DPCONTENTS_SLIME | DPCONTENTS_LAVA)
-// | DPCONTENTS_MONSTERCLIP | DPCONTENTS_DONOTENTER
-float walknode_stepsize;
+float  walknode_stepsize;
 vector walknode_stepup;
 vector walknode_maxdrop;
 vector walknode_boxup;
 vector walknode_boxmax;
 vector walknode_boxmin;
-float pathlib_movenode_goodnode;
+float  pathlib_movenode_goodnode;
 
 float floor_ok(vector point)
 {
@@ -173,15 +161,16 @@
     return 0;
 }
 
+#define inwater(point) (pointcontents(point) == CONTENT_WATER)
+/*
 float inwater(vector point)
 {
     if(pointcontents(point) == CONTENT_WATER)
         return 1;
-
     return 0;
 }
+*/
 
-//#define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if(trace_fraction == 1.0) return 1
 #define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if not(floor_ok(trace_endpos)) return 1
 float edge_check(vector point,float fsize)
 {
@@ -245,17 +234,13 @@
         if(pointcontents(surface) == CONTENT_EMPTY)
             break;
     }
-    //mark_error(surface,10);
 
     if(pointcontents(surface + '0 0 1') != CONTENT_EMPTY)
         return end;
 
     tracebox(start + '0 0 64', walknode_boxmin,walknode_boxmax, end + '0 0 64', MOVE_WORLDONLY, self);
     if(trace_fraction == 1)
-    {
         pathlib_movenode_goodnode = 1;
-        //mark_error(end + '0 0 64',30);
-    }
 
     if(fabs(surface_z - end_z) > 32)
         pathlib_movenode_goodnode = 0;
@@ -287,13 +272,6 @@
 {
     pathlib_movenode_goodnode = 0;
 
-    /*
-    if(pointcontents(start) == CONTENT_EMPTY)
-        return end;
-
-    if(pointcontents(end) == CONTENT_EMPTY)
-        return end;
-    */
     end_x = fsnap(end_x, pathlib_gridsize);
     end_y = fsnap(end_y, pathlib_gridsize);
 
@@ -394,24 +372,48 @@
         return parent.pathlib_node_g + static_cost;
 }
 
+float pathlib_g_static_water(entity parent,vector to, float static_cost)
+{
+    if(inwater(to))
+        return parent.pathlib_node_g + static_cost * pathlib_movecost_waterfactor;
+    else
+        return parent.pathlib_node_g + static_cost;
+}
+
 float pathlib_g_euclidean(entity parent,vector to, float static_cost)
 {
-    return vlen(parent.origin - to);
+    return parent.pathlib_node_g + vlen(parent.origin - to);
 }
+float pathlib_g_euclidean_water(entity parent,vector to, float static_cost)
+{
+    if(inwater(to))
+        return parent.pathlib_node_g + vlen(parent.origin - to) * pathlib_movecost_waterfactor;
+    else
+        return parent.pathlib_node_g + vlen(parent.origin - to);
+}
 
 var float(vector from,vector to) pathlib_heuristic;
+
+/**
+    Manhattan Menas we expect to move up,down left or right
+    No diagonal moves espected. (like moving bewteen city blocks)
+**/
 float pathlib_h_manhattan(vector a,vector b)
 {
     //h(n) = D * (abs(n.x-goal.x) + abs(n.y-goal.y))
 
     float h;
-    h = fabs(a_x - b_x);
-    h = h + fabs(a_y - b_y);
-    h = pathlib_gridsize * h;
+    h  = fabs(a_x - b_x);
+    h += fabs(a_y - b_y);
+    h *= pathlib_gridsize;
 
     return h;
 }
 
+/**
+    This heuristic consider both stright and disagonal moves
+    to have teh same cost.
+**/
 float pathlib_h_diagonal(vector a,vector b)
 {
     //h(n) = D * max(abs(n.x-goal.x), abs(n.y-goal.y))
@@ -424,11 +426,20 @@
     return h;
 }
 
+/**
+    This heuristic only considers the stright line distance.
+    Will usualy mean a lower H then G meaning A* Will speand more
+    and run slower.
+**/
 float pathlib_h_euclidean(vector a,vector b)
 {
     return vlen(a - b);
 }
 
+/**
+    This heuristic consider both stright and disagonal moves,
+    But has a separate cost for diagonal moves.
+**/
 float pathlib_h_diagonal2(vector a,vector b)
 {
     float h_diag,h_str,h,x,y;
@@ -451,35 +462,12 @@
     return h;
 }
 
-float pathlib_h_diagonal2tbs(vector start,vector point,vector end)
-{
-    float h_diag,h_str,h,x,y;
+/**
+    This heuristic consider both stright and disagonal moves,
+    But has a separate cost for diagonal moves.
 
-    /*
-    h_diagonal(n) = min(abs(n.x-goal.x), abs(n.y-goal.y))
-    h_straight(n) = (abs(n.x-goal.x) + abs(n.y-goal.y))
-    h(n) = D2 * h_diagonal(n) + D * (h_straight(n) - 2*h_diagonal(n)))
-    */
 
-    float dx1,dx2,dy1,dy2,fcross;
-    dx1 = point_x - end_x;
-    dy1 = point_y - end_y;
-    dx2 = start_x - end_x;
-    dy2 = start_y - end_y;
-    fcross = fabs(dx1*dy2 - dx2*dy1);
-
-    x = fabs(point_x - end_x);
-    y = fabs(point_y - end_y);
-
-    h_diag = min(x,y);
-    h_str = x + y;
-
-    h =  pathlib_movecost_diag * h_diag;
-    h += pathlib_movecost * (h_str - 2 * h_diag);
-
-    return h + (fcross * 0.001);
-}
-
+**/
 float pathlib_h_diagonal2sdp(vector preprev,vector prev,vector point,vector end)
 {
     float h_diag,h_str,h,x,y,z;
@@ -501,13 +489,11 @@
     float m;
     vector d1,d2;
 
-    m = 0.999;
-    d1 = normalize(preprev - prev);
-    d2 = normalize(prev - point);
-    if(vlen(d1-d2) > 0.6)
-        m = 1;
+    d1 = normalize(preprev - point);
+    d2 = normalize(prev    - point);
+    m = vlen(d1-d2);
+    //bprint("pathlib_h_diagonal2sdp-M = ",ftos(m),"\n");
 
-
     return h * m;
 }
 
@@ -530,13 +516,11 @@
     h =  pathlib_movecost_diag * h_diag;
     h += pathlib_movecost * (h_str - 2 * h_diag);
 
-    //if(inwater(a))
-    //h =
-
     return h;
 }
 
 //#define PATHLIB_USE_NODESCRAP
+#define PATHLIB_NODEEXPIRE 0.05
 float pathlib_scraplist_cnt;
 entity newnode()
 {
@@ -557,6 +541,9 @@
 #endif
     ++pathlib_made_cnt;
     n = spawn();
+#ifdef PATHLIB_NODEEXPIRE
+    n.think      = SUB_Remove;
+    n.nextthink  = time + PATHLIB_NODEEXPIRE;
     return n;
 }
 
@@ -564,11 +551,15 @@
 {
 #ifdef PATHLIB_USE_NODESCRAP
     ++pathlib_scraplist_cnt;
-    n.owner = scraplist;
+
+    n.path_next    = world;
+    n.path_prev    = world;
+    n.is_path_node = FALSE;
+    n.owner        = scraplist;
 #else
-    n.is_path_node = FALSE;
-    n.think = SUB_Remove;
-    n.nextthink= time;
+    //n.is_path_node = FALSE;
+    n.think        = SUB_Remove;
+    n.nextthink    = time;
 #endif
 }
 
@@ -585,19 +576,17 @@
 
     ++pathlib_open_cnt;
 
-    //if(inwater(where))
-    //{
-        //node.waterlevel = 1;
-        //mark_info(where,5);
-    //}
-    //mark_info(where,30);
+    node.medium = pointcontents(where);
+
     return node;
 }
+
 var float pathlib_expandnode(entity node, vector start, vector goal);
 float pathlib_expandnode_star(entity node, vector start, vector goal);
 float pathlib_expandnode_box(entity node, vector start, vector goal);
 
-float pathlib_makenode(entity parent,vector start, vector to, vector goal,float cost)
+var float pathlib_makenode(entity parent,vector start, vector to, vector goal,float cost);
+float pathlib_makenode_adaptive(entity parent,vector start, vector to, vector goal,float cost)
 {
     entity node;
     float h,g,f,doedge;
@@ -607,32 +596,19 @@
 
     if(inwater(parent.origin))
     {
-        if(inwater(to))
-        {
-            //bprint("Switch to water tracing\n");
-            pathlib_expandnode = pathlib_expandnode_box;
-            pathlib_movenode   = pathlib_swimnode;
-        }
-        else
-        {
-
-            //bprint("Switch to get out of water tracing\n");
-            pathlib_expandnode = pathlib_expandnode_box;
-            pathlib_movenode   = pathlib_swimnode;
-        }
+        pathlib_expandnode = pathlib_expandnode_box;
+        pathlib_movenode   = pathlib_swimnode;
     }
     else
     {
         if(inwater(to))
         {
-            //bprint("Switch to get into water tracing\n");
             pathlib_expandnode = pathlib_expandnode_box;
             pathlib_movenode   = pathlib_swimnode;
         }
         else
         {
 
-            //bprint("Switch to land tracing\n");
             pathlib_expandnode = pathlib_expandnode_star;
             pathlib_movenode   = pathlib_walknode;
             doedge = 1;
@@ -641,26 +617,16 @@
 
     where = pathlib_movenode(parent.origin,to,0);
     if not(pathlib_movenode_goodnode)
-    {
-        //mark_error(where,15);
         return 0;
-    }
 
     if(doedge)
     if(edge_check(where,pathlib_edge_check_size))
         return 0;
 
-    h = pathlib_heuristic(where,goal);
-
-    /*
     if(parent.path_prev)
-        h = pathlib_h_diagonal2sdp(parent.path_prev.origin,parent.origin,where,goal);
-    else
-        h = pathlib_heuristic(where,goal);
-    */
+        pathlib_h_diagonal2sdp(parent.path_prev.origin,parent.origin,where,goal);
 
-
-    //h = 0;
+    h = pathlib_heuristic(where,goal);
     g = pathlib_cost(parent,where,cost);
     f = g + h;
 
@@ -692,7 +658,6 @@
     }
 
     node = pathlib_mknode(where,parent);
-
     node.pathlib_node_h = h;
     node.pathlib_node_g = g;
     node.pathlib_node_f = f;
@@ -754,14 +719,14 @@
 
     if(vlen(node.origin - goal) <= pathlib_gridsize)
     {
-        //if(vlen(node.origin - goal) < 128)
         vector goalmove;
+
         goalmove = pathlib_walknode(node.origin,goal,1);
         if(pathlib_movenode_goodnode)
-            {
-                goal_node         = node;
-                pathlib_foundgoal = TRUE;
-            }
+        {
+            goal_node         = node;
+            pathlib_foundgoal = TRUE;
+        }
     }
 }
 
@@ -830,14 +795,9 @@
 {
     entity node;
 
-    best_open_node = world;
-
     node = findfloat(world,is_path_node, TRUE);
     while(node)
     {
-        node.path_next = world;
-        node.path_prev = world;
-        node.is_path_node = FALSE;
         dumpnode(node);
         node = findfloat(node,is_path_node, TRUE);
     }
@@ -847,20 +807,96 @@
 
     if(closedlist)
         remove(closedlist);
+
+    best_open_node = world;
+    openlist       = world;
+    closedlist     = world;
 }
 
-entity pathlib_astar(vector from,vector to)
+var float buildpath_nodefilter(vector n,vector c,vector p);
+float buildpath_nodefilter_directional(vector n,vector c,vector p)
 {
+    vector d1,d2;
+
+    d2 = normalize(p - c);
+    d1 = normalize(c - n);
+
+    if(vlen(d1-d2) < 0.25)
+        return 1;
+
+    return 0;
+}
+
+float buildpath_nodefilter_moveskip(vector n,vector c,vector p)
+{
+    pathlib_walknode(p,n,1);
+    if(pathlib_movenode_goodnode)
+        return 1;
+
+    return 0;
+}
+
+entity path_build(entity next, vector where, entity prev, entity start)
+{
     entity path;
-    entity open,n;
 
+    if(prev && next)
+        if(buildpath_nodefilter)
+            if(buildpath_nodefilter(next.origin,where,prev.origin))
+                return next;
+
+
+    path           = spawn();
+    path.owner     = start;
+    path.path_next = next;
+
+    setorigin(path,where);
+
+    if(!next)
+        path.classname = "path_end";
+    else
+    {
+        if(!prev)
+            path.classname = "path_start";
+        else
+            path.classname = "path_node";
+    }
+
+    return path;
+}
+
+entity pathlib_astar(vector from,vector to)
+{
+    entity path, start, end, open, n, ln;
+    float ptime, ftime, ctime;
+
+    ptime = gettime(GETTIME_REALTIME);
+
     pathlib_cleanup();
 
-    pathlib_heuristic  = pathlib_h_diagonal3;
-    pathlib_cost       = pathlib_g_static;
-    pathlib_expandnode = pathlib_expandnode_star;
-    pathlib_movenode   = pathlib_walknode;
+    // Select water<->land capable node make/link
+    pathlib_makenode     = pathlib_makenode_adaptive;
+    // Select XYZ cost estimate
+    pathlib_heuristic    = pathlib_h_diagonal3;
+    // Select distance + waterfactor cost
+    pathlib_cost         = pathlib_g_euclidean_water;
+    // Select star expander
+    pathlib_expandnode   = pathlib_expandnode_star;
+    // Select walk simulation movement test
+    pathlib_movenode     = pathlib_walknode;
+    // Filter final nodes by direction
+    buildpath_nodefilter = buildpath_nodefilter_directional;
 
+    // If the start is in water we need diffrent settings
+    if(inwater(from))
+    {
+        // Select volumetric node expaner
+        pathlib_expandnode = pathlib_expandnode_box;
+
+        // Water movement test
+        pathlib_movenode   = pathlib_swimnode;
+    }
+
     if not(openlist)
         openlist       = spawn();
 
@@ -870,16 +906,17 @@
     if not(scraplist)
         scraplist      = spawn();
 
-    pathlib_closed_cnt     = 0;
-    pathlib_open_cnt       = 0;
-    pathlib_made_cnt       = 0;
-    pathlib_merge_cnt      = 0;
-    pathlib_searched_cnt   = 0;
-    pathlib_bestcash_hits  = 0;
-    pathlib_bestcash_saved = 0;
-    pathlib_recycle_cnt    = 0;
+    pathlib_closed_cnt       = 0;
+    pathlib_open_cnt         = 0;
+    pathlib_made_cnt         = 0;
+    pathlib_merge_cnt        = 0;
+    pathlib_searched_cnt     = 0;
+    pathlib_bestopen_seached = 0;
+    pathlib_bestcash_hits    = 0;
+    pathlib_bestcash_saved   = 0;
+    pathlib_recycle_cnt      = 0;
 
-    pathlib_gridsize       = 192;
+    pathlib_gridsize       = 128;
     pathlib_movecost       = pathlib_gridsize;
     pathlib_movecost_diag  = vlen(('1 1 0' * pathlib_gridsize));
     pathlib_movecost_waterfactor = 1.1;
@@ -888,24 +925,31 @@
     walknode_boxmax   = self.maxs * 1.5;
     walknode_boxmin   = self.mins * 1.5;
 
-    pathlib_edge_check_size = (vlen(walknode_boxmin - walknode_boxmax) * 0.25);
+    pathlib_edge_check_size = (vlen(walknode_boxmin - walknode_boxmax) * 0.5);
 
     walknode_boxup    = '0 0 2' * self.maxs_z;
     walknode_stepsize = 32;
     walknode_stepup   = '0 0 1' * walknode_stepsize;
     walknode_maxdrop  = '0 0 3' * walknode_stepsize;
 
+    from_x = fsnap(from_x,pathlib_gridsize);
+    from_y = fsnap(from_y,pathlib_gridsize);
+
+    to_x = fsnap(to_x,pathlib_gridsize);
+    to_y = fsnap(to_y,pathlib_gridsize);
+
     dprint("AStar init. ", ftos(pathlib_scraplist_cnt), " nodes on scrap\n");
     path = pathlib_mknode(from,world);
     pathlib_close_node(path,to);
     if(pathlib_foundgoal)
     {
-        dprint("A* Goal fond in first square!\n");
+        dprint("AStar: Goal found on first node!\n");
 
         open           = spawn();
         open.owner     = open;
         open.classname = "path_end";
         setorigin(open,path.origin);
+
         pathlib_cleanup();
 
         return open;
@@ -913,8 +957,9 @@
 
     if(pathlib_expandnode(path,from,to) <= 0)
     {
-        dprint("A* pathing fail\n");
+        dprint("AStar path fail.\n");
         pathlib_cleanup();
+
         return world;
     }
 
@@ -939,53 +984,55 @@
 
         if(pathlib_foundgoal)
         {
-            dprint("Path found, re-tracing...\n");
+            dprint("Target found. Rebuilding and filtering path...\n");
+            ftime = gettime(GETTIME_REALTIME);
+            ptime = ftime - ptime;
 
-            open              = goal_node;
-            open.is_path_node = FALSE;
-            open.classname    = "path_end";
-            open.owner        = path;
-            open.path_next    = world;
+            start = path_build(world,path.origin,world,world);
+            end   = path_build(world,goal_node.origin,world,start);
+            ln    = end;
 
-
-            while(open.path_prev != path)
+            open = goal_node;
+            for(open = goal_node; open.path_prev != path; open = open.path_prev)
             {
-                n                 = open;
-                open              = open.path_prev;
-                open.owner        = path;
-                open.path_next    = n;
-
-                open.is_path_node = FALSE;
-                open.classname    = "path_node";
+                n    = path_build(ln,open.origin,open.path_prev,start);
+                ln.path_prev = n;
+                ln = n;
             }
+            start.path_next = n;
+            n.path_prev = start;
+            ftime = gettime(GETTIME_REALTIME) - ftime;
 
-            open.path_prev    = path;
-            path.path_next    = open;
-            path.classname    = "path_master";
-            path.is_path_node = FALSE;
-            path.owner        = path;
-
+            ctime = gettime(GETTIME_REALTIME);
             pathlib_cleanup();
+            ctime = gettime(GETTIME_REALTIME) - ctime;
 
+
 #ifdef DEBUGPATHING
-            dprint("Chain done..\n");
-            pathlib_showpath2(path);
+            pathlib_showpath2(start);
 
+            dprint("Time used -      pathfinding: ", ftos(ptime),"\n");
+            dprint("Time used - rebuild & filter: ", ftos(ftime),"\n");
+            dprint("Time used -          cleanup: ", ftos(ctime),"\n");
+            dprint("Time used -            total: ", ftos(ptime + ftime + ctime),"\n");
+            dprint("Time used -         # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_ticrate)),"\n\n");
+            dprint("Nodes -         created: ", ftos(pathlib_made_cnt),"\n");
+            dprint("Nodes -            open: ", ftos(pathlib_open_cnt),"\n");
+            dprint("Nodes -          merged: ", ftos(pathlib_merge_cnt),"\n");
+            dprint("Nodes -          closed: ", ftos(pathlib_closed_cnt),"\n");
+            dprint("Nodes -        searched: ", ftos(pathlib_searched_cnt),"\n");
 
-            dprint("           Nodes reused: ", ftos(pathlib_recycle_cnt),"\n");
-            dprint("          Nodes created: ", ftos(pathlib_made_cnt),"\n");
-            dprint("       Nodes make/reuse: ", ftos(pathlib_made_cnt / pathlib_recycle_cnt),"\n");
-            dprint("             Nodes open: ", ftos(pathlib_open_cnt),"\n");
-            dprint("           Nodes merged: ", ftos(pathlib_merge_cnt),"\n");
-            dprint("           Nodes closed: ", ftos(pathlib_closed_cnt),"\n");
-            dprint("         Nodes searched: ", ftos(pathlib_searched_cnt),"\n");
+        if(pathlib_recycle_cnt)
+            dprint("Nodes -      make/reuse: ", ftos(pathlib_made_cnt / pathlib_recycle_cnt),"\n");
+        if(pathlib_recycle_cnt)
+            dprint("Nodes -          reused: ", ftos(pathlib_recycle_cnt),"\n");
+
             dprint("Nodes bestopen searched: ", ftos(pathlib_bestopen_seached),"\n");
-            dprint("    Nodes bestcash hits: ", ftos(pathlib_bestcash_hits),"\n");
-            dprint("    Nodes bestcash save: ", ftos(pathlib_bestcash_saved),"\n");
+            dprint("Nodes bestcash -   hits: ", ftos(pathlib_bestcash_hits),"\n");
+            dprint("Nodes bestcash -   save: ", ftos(pathlib_bestcash_saved),"\n");
             dprint("AStar done. ", ftos(pathlib_scraplist_cnt), " nodes on scrap\n\n");
-
 #endif
-            return path;
+            return start;
         }
     }
 
@@ -996,3 +1043,5 @@
     return world;
 }
 
+
+

Modified: branches/nexuiz-2.0/data/qcsrc/server/progs.src
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/progs.src	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/progs.src	2009-03-27 18:16:42 UTC (rev 6333)
@@ -22,6 +22,7 @@
 ../common/util.qc
 
 csqcprojectile.qh
+csqceffects.qc
 
 portals.qh
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/steerlib.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/steerlib.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/steerlib.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,3 +1,5 @@
+.vector steerto;
+
 /**
     Uniform pull towards a point
 **/
@@ -260,10 +262,48 @@
 
     return (upwish+leftwish+downwish+rightwish) * 0.25;
 
-}
+}
 
+/**
+    Steer towards the direction least obstructed.
+    Run two tracelines in a forward trident, bias each diretion negative if something is found there.
+**/
+vector steerlib_traceavoid_flat(float pitch, float length, vector vofs)
+{
+    vector vt_left, vt_right,vt_front;
+    float f_left, f_right,f_front;
+    vector leftwish, rightwish,frontwish, v_left;
+
+    v_left = v_right * -1;
+
+
+    vt_front = v_forward * length;
+    traceline(self.origin + vofs, self.origin + vofs + vt_front,MOVE_NOMONSTERS,self);
+    f_front = trace_fraction;
+
+    vt_left = (v_forward + (v_left * pitch)) * length;
+    traceline(self.origin + vofs, self.origin + vofs + vt_left,MOVE_NOMONSTERS,self);
+    f_left = trace_fraction;
+
+    //te_lightning1(world,self.origin, trace_endpos);
+
+    vt_right = (v_forward + (v_right * pitch)) * length;
+    traceline(self.origin + vofs, self.origin + vofs + vt_right ,MOVE_NOMONSTERS,self);
+    f_right = trace_fraction;
+
+    //te_lightning1(world,self.origin, trace_endpos);
+
+    leftwish  = v_left    * f_left;
+    rightwish = v_right   * f_right;
+    frontwish = v_forward * f_front;
+
+    return normalize(leftwish + rightwish + frontwish);
+
+}
+
 
 
+
 //////////////////////////////////////////////
 //     Testting                             //
 // Everything below this point is a mess :D //

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -729,7 +729,7 @@
 	if(self.team)
 		self.flags |= FL_NO_WEAPON_STAY;
 
-	if(g_weapon_stay == 2)
+	if(g_weapon_stay == 2 && self.classname != "droppedweapon")
 	{
 		self.ammo_shells = 0;
 		self.ammo_nails = 0;

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_jumppads.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_jumppads.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_jumppads.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -8,6 +8,12 @@
 
 float trigger_push_calculatevelocity_flighttime;
 
+void trigger_push_use()
+{
+	if(teams_matter)
+		self.team = activator.team;
+}
+
 /*
 	trigger_push_calculatevelocity
 
@@ -134,6 +140,10 @@
 	if (other.deadflag && other.iscreature)
 		return;
 
+	if(self.team)
+		if((self.spawnflags & 4 == 0) == (self.team != other.team))
+			return;
+
 	EXACTTRIGGER_TOUCH;
 
 	if(self.target)
@@ -259,6 +269,7 @@
 
 	EXACTTRIGGER_INIT;
 
+	self.use = trigger_push_use;
 	self.touch = trigger_push_touch;
 
 	// normal push setup

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,3 +1,9 @@
+void trigger_teleport_use()
+{
+	if(teams_matter)
+		self.team = activator.team;
+}
+
 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax)
 {
 	entity head;
@@ -109,6 +115,10 @@
 	if (!other.flags & FL_CLIENT)	// FIXME: Make missiles firable through the teleport too
 		return;
 
+	if(self.team)
+		if((self.spawnflags & 4 == 0) == (self.team != other.team))
+			return;
+
 	EXACTTRIGGER_TOUCH;
 
 	makevectors(self.enemy.mangle);
@@ -220,6 +230,8 @@
 
 	EXACTTRIGGER_INIT;
 
+	self.use = trigger_teleport_use;
+
 	// this must be called to spawn the teleport waypoints for bots
 	InitializeEntity(self, teleport_findtarget, INITPRIO_FINDTARGET);
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -432,6 +432,8 @@
 		modifications = strcat(modifications, ", Weapons stay");
 	if(g_bloodloss > 0)
 		modifications = strcat(modifications, ", Bloodloss");
+	if(g_jetpack)
+		modifications = strcat(modifications, ", Jet pack");
 	modifications = substring(modifications, 2, strlen(modifications) - 2);
 
 	local string versionmessage;

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/include/turrets_early.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/include/turrets_early.qh	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/include/turrets_early.qh	2009-03-27 18:16:42 UTC (rev 6333)
@@ -448,11 +448,11 @@
 * Stuff to plug into requierd but unused callbacks.
 */
 /// Always return 1
-float turret_stdproc_true();
+//float turret_stdproc_true();
 /// Always return 0
-float turret_stdproc_false();
+//float turret_stdproc_false();
 /// Always return nothing at all
-void turret_stdproc_nothing();
+//void turret_stdproc_nothing();
 
 /*
 * Target selection

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_damage.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_damage.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_damage.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -180,7 +180,7 @@
     }
 
 // Go boom
-    RadiusDamage (self,self, min(self.ammo,50),min(self.ammo,50) * 0.25,250,world,min(self.ammo,50)*5,0,world);
+    RadiusDamage (self,self, min(self.ammo,50),min(self.ammo,50) * 0.25,250,world,min(self.ammo,50)*5,DEATH_TURRET,world);
 
     if(self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
     {
@@ -336,5 +336,3 @@
         baseent.think = turret_stdproc_die;
     }
 }
-
-

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_main.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_main.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,13 +1,5 @@
 #define cvar_base "g_turrets_unit_"
 
-#define cvar_gets(s_base,s_add) strcat(s_base,s_add)
-/*
-string cvar_gets(string s_base,string s_add)
-{
-    return strcat(s_base,s_add);
-}
-*/
-
 void load_unit_settings(entity ent,string unitname,float is_reload)
 {
 
@@ -31,43 +23,48 @@
     {
         ent.enemy = world;
         ent.tur_head.avelocity = '0 0 0';
-        ent.tur_head.angles = ent.angles;
+
+        if (ent.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
+            ent.tur_head.angles = '0 0 0';
+        else
+            ent.tur_head.angles = ent.angles;
     }
-    ent.health      = cvar(cvar_gets(sbase,"_health")) * ent.turret_scale_health;
-    ent.respawntime = cvar(cvar_gets(sbase,"_respawntime")) * ent.turret_scale_respawn;
 
-    ent.shot_dmg          = cvar(cvar_gets(sbase,"_shot_dmg")) * ent.turret_scale_damage;
-    ent.shot_refire       = cvar(cvar_gets(sbase,"_shot_refire")) * ent.turret_scale_refire;
-    ent.shot_radius       = cvar(cvar_gets(sbase,"_shot_radius")) * ent.turret_scale_damage;
-    ent.shot_speed        = cvar(cvar_gets(sbase,"_shot_speed"));
-    ent.shot_spread       = cvar(cvar_gets(sbase,"_shot_spread"));
-    ent.shot_force        = cvar(cvar_gets(sbase,"_shot_force")) * ent.turret_scale_damage;
-    ent.shot_volly        = cvar(cvar_gets(sbase,"_shot_volly"));
-    ent.shot_volly_refire = cvar(cvar_gets(sbase,"_shot_volly_refire")) * ent.turret_scale_refire;
+    ent.health      = cvar(strcat(sbase,"_health")) * ent.turret_scale_health;
+    ent.respawntime = cvar(strcat(sbase,"_respawntime")) * ent.turret_scale_respawn;
 
-    ent.target_range         = cvar(cvar_gets(sbase,"_target_range")) * ent.turret_scale_range;
-    ent.target_range_min     = cvar(cvar_gets(sbase,"_target_range_min")) * ent.turret_scale_range;
-    ent.target_range_fire    = cvar(cvar_gets(sbase,"_target_range_fire")) * ent.turret_scale_range;
-    ent.target_range_optimal = cvar(cvar_gets(sbase,"_target_range_optimal")) * ent.turret_scale_range;
+    ent.shot_dmg          = cvar(strcat(sbase,"_shot_dmg")) * ent.turret_scale_damage;
+    ent.shot_refire       = cvar(strcat(sbase,"_shot_refire")) * ent.turret_scale_refire;
+    ent.shot_radius       = cvar(strcat(sbase,"_shot_radius")) * ent.turret_scale_damage;
+    ent.shot_speed        = cvar(strcat(sbase,"_shot_speed"));
+    ent.shot_spread       = cvar(strcat(sbase,"_shot_spread"));
+    ent.shot_force        = cvar(strcat(sbase,"_shot_force")) * ent.turret_scale_damage;
+    ent.shot_volly        = cvar(strcat(sbase,"_shot_volly"));
+    ent.shot_volly_refire = cvar(strcat(sbase,"_shot_volly_refire")) * ent.turret_scale_refire;
 
-    ent.target_select_rangebias  = cvar(cvar_gets(sbase,"_target_select_rangebias"));
-    ent.target_select_samebias   = cvar(cvar_gets(sbase,"_target_select_samebias"));
-    ent.target_select_anglebias  = cvar(cvar_gets(sbase,"_target_select_anglebias"));
-    ent.target_select_playerbias = cvar(cvar_gets(sbase,"_target_select_playerbias"));
+    ent.target_range         = cvar(strcat(sbase,"_target_range")) * ent.turret_scale_range;
+    ent.target_range_min     = cvar(strcat(sbase,"_target_range_min")) * ent.turret_scale_range;
+    ent.target_range_fire    = cvar(strcat(sbase,"_target_range_fire")) * ent.turret_scale_range;
+    ent.target_range_optimal = cvar(strcat(sbase,"_target_range_optimal")) * ent.turret_scale_range;
+
+    ent.target_select_rangebias  = cvar(strcat(sbase,"_target_select_rangebias"));
+    ent.target_select_samebias   = cvar(strcat(sbase,"_target_select_samebias"));
+    ent.target_select_anglebias  = cvar(strcat(sbase,"_target_select_anglebias"));
+    ent.target_select_playerbias = cvar(strcat(sbase,"_target_select_playerbias"));
     //ent.target_select_fov = cvar(cvar_gets(sbase,"_target_select_fov"));
 
-    ent.ammo_max      = cvar(cvar_gets(sbase,"_ammo_max")) * ent.turret_scale_ammo;
-    ent.ammo_recharge = cvar(cvar_gets(sbase,"_ammo_recharge")) * ent.turret_scale_ammo;
+    ent.ammo_max      = cvar(strcat(sbase,"_ammo_max")) * ent.turret_scale_ammo;
+    ent.ammo_recharge = cvar(strcat(sbase,"_ammo_recharge")) * ent.turret_scale_ammo;
 
-    ent.aim_firetolerance_dist = cvar(cvar_gets(sbase,"_aim_firetolerance_dist"));
-    ent.aim_speed    = cvar(cvar_gets(sbase,"_aim_speed")) * ent.turret_scale_aim;
-    ent.aim_maxrot   = cvar(cvar_gets(sbase,"_aim_maxrot"));
-    ent.aim_maxpitch = cvar(cvar_gets(sbase,"_aim_maxpitch"));
+    ent.aim_firetolerance_dist = cvar(strcat(sbase,"_aim_firetolerance_dist"));
+    ent.aim_speed    = cvar(strcat(sbase,"_aim_speed")) * ent.turret_scale_aim;
+    ent.aim_maxrot   = cvar(strcat(sbase,"_aim_maxrot"));
+    ent.aim_maxpitch = cvar(strcat(sbase,"_aim_maxpitch"));
 
-    ent.track_type        = cvar(cvar_gets(sbase,"_track_type"));
-    ent.track_accel_pitch = cvar(cvar_gets(sbase,"_track_accel_pitch"));
-    ent.track_accel_rot   = cvar(cvar_gets(sbase,"_track_accel_rot"));
-    ent.track_blendrate   = cvar(cvar_gets(sbase,"_track_blendrate"));
+    ent.track_type        = cvar(strcat(sbase,"_track_type"));
+    ent.track_accel_pitch = cvar(strcat(sbase,"_track_accel_pitch"));
+    ent.track_accel_rot   = cvar(strcat(sbase,"_track_accel_rot"));
+    ent.track_blendrate   = cvar(strcat(sbase,"_track_blendrate"));
 
     if(is_reload)
         if(ent.turret_respawnhook)
@@ -75,6 +72,7 @@
 
 }
 
+/*
 float turret_stdproc_true()
 {
     return 1;
@@ -85,10 +83,12 @@
     return 0;
 }
 
+
 void turret_stdproc_nothing()
 {
     return;
 }
+*/
 
 /**
 ** updates enemy distances, predicted impact point/time
@@ -102,21 +102,6 @@
     oldself = self;
     self = t_turret;
 
-    if (self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
-    {
-        self.tur_head.angles_x = self.tur_head.angles_x * -1;
-        self.angles_x = self.angles_x * -1;
-        makevectors(self.tur_head.angles + self.angles);
-        self.tur_head.angles_x = self.tur_head.angles_x * -1;
-        self.angles_x = self.angles_x * -1;
-    }
-    else
-    {
-        self.tur_head.angles_x = self.tur_head.angles_x * -1;
-        makevectors(self.tur_head.angles);
-        self.tur_head.angles_x = self.tur_head.angles_x * -1;
-    }
-
     enemy_pos = real_origin(self.enemy);
 
     turret_tag_fire_update();
@@ -222,149 +207,133 @@
 //.entity aim_mark;
 void turret_stdproc_track()
 {
-    vector wish_angle;  // This is where we want to aim
-
-    vector real_angle;  // This is where we can aim
+    vector target_angle; // This is where we want to aim
+    vector move_angle;   // This is where we can aim
     float f_tmp;
 
     if (self.track_flags == TFL_TRACK_NO)
         return;
 
-
     if(!self.tur_active)
-    {
-        wish_angle = self.idle_aim - ('1 0 0' * self.aim_maxpitch);
-    }
+        target_angle = self.idle_aim - ('1 0 0' * self.aim_maxpitch);
     else if (self.enemy == world)
     {
         if(time > self.lip)
             if (self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
-                wish_angle = self.idle_aim + self.angles;
+                target_angle = self.idle_aim + self.angles;
             else
-                wish_angle = self.idle_aim;
+                target_angle = self.idle_aim;
         else
-            wish_angle = vectoangles(normalize(self.tur_aimpos - self.tur_head.origin));
+            target_angle = vectoangles(normalize(self.tur_aimpos - self.tur_shotorg));
     }
     else
     {
         // Find the direction
-        /*
-        if (self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
-            wish_angle = normalize(self.tur_aimpos - self.tur_shotorg);
-        else
-        */
-        wish_angle = normalize(self.tur_aimpos - self.tur_shotorg);
-        wish_angle = vectoangles(wish_angle); // And make a angle
+        target_angle = normalize(self.tur_aimpos - self.tur_shotorg);
+        target_angle = vectoangles(target_angle); // And make a angle
     }
 
-    self.tur_head.angles_x = anglemods(self.tur_head.angles_x);
-    self.tur_head.angles_y = anglemods(self.tur_head.angles_y);
+    self.tur_head.angles_x = safeangle(self.tur_head.angles_x);
+    self.tur_head.angles_y = safeangle(self.tur_head.angles_y);
 
     // Find the diffrence between where we currently aim and where we want to aim
+    vector a_off;
+
+
     if (self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
     {
-            real_angle = wish_angle - (self.angles + self.tur_head.angles);
-            real_angle = shortangle_v(real_angle,(self.angles + self.tur_head.angles));
+        move_angle = target_angle - (self.angles + self.tur_head.angles);
+        move_angle = shortangle_vxy(move_angle,(self.angles + self.tur_head.angles));
+        a_off = '0 0 0';
+
     }
     else
     {
-        real_angle = wish_angle - self.tur_head.angles;
-        real_angle = shortangle_v(real_angle,self.tur_head.angles);
+        move_angle = target_angle - self.tur_head.angles;
+        move_angle = shortangle_vxy(move_angle,self.tur_head.angles);
+        a_off = self.angles;
     }
 
-    // Limit pitch
-    if (self.track_flags & TFL_TRACK_PITCH)
-        real_angle_x = bound(self.aim_maxpitch * -1,real_angle_x,self.aim_maxpitch);
-
-    // Limit rot
-    if (self.track_flags & TFL_TRACK_ROT)
-        real_angle_y = bound(self.aim_maxrot * -1,real_angle_y,self.aim_maxrot);
-
     switch(self.track_type)
     {
         case TFL_TRACKTYPE_STEPMOTOR:
-
-            /*
-            setorigin(self.aim_mark,self.tur_aimpos);
-            wish_angle = normalize(self.tur_aimpos -  self.tur_shotorg_updated);
-            real_angle = vectoangles(wish_angle);
-            self.tur_head.angles = real_angle;
-            return;
-            */
             f_tmp = self.aim_speed * self.ticrate; // dgr/sec -> dgr/tic
-
-            // Limit turning speed
-            real_angle_x = bound((-1 * f_tmp),real_angle_x, f_tmp);
-            real_angle_y = bound((-1 * f_tmp),real_angle_y, f_tmp);
-
-            // Limit pich and rot.
             if (self.track_flags & TFL_TRACK_PITCH)
-                self.tur_head.angles_x = bound((-1 * self.aim_maxpitch),self.tur_head.angles_x + real_angle_x,self.aim_maxpitch);
+            {
+                self.tur_head.angles_x += bound(-f_tmp,move_angle_x, f_tmp);
+                if(self.tur_head.angles_x + a_off_x > self.aim_maxpitch)
+                    self.tur_head.angles_x = a_off_x + self.aim_maxpitch;
 
+                if(self.tur_head.angles_x + a_off_x < -self.aim_maxpitch)
+                    self.tur_head.angles_x = a_off_x - self.aim_maxpitch;
+            }
+
             if (self.track_flags & TFL_TRACK_ROT)
-                self.tur_head.angles_y = bound((-1 * self.aim_maxrot),self.tur_head.angles_y  + real_angle_y,self.aim_maxrot);
+            {
+                self.tur_head.angles_y += bound(-f_tmp, move_angle_y, f_tmp);
+                if((self.tur_head.angles_y - a_off_y) > self.aim_maxrot)
+                    self.tur_head.angles_y = a_off_y + self.aim_maxrot;
 
+                if((self.tur_head.angles_y - a_off_y) < -self.aim_maxrot)
+                    self.tur_head.angles_y = a_off_y - self.aim_maxrot;
+            }
+
             return;
 
+        case TFL_TRACKTYPE_FLUIDINERTIA:
+            f_tmp = self.aim_speed * self.ticrate; // dgr/sec -> dgr/tic
+            move_angle_x = bound(-self.aim_speed, move_angle_x * self.track_accel_pitch * f_tmp,self.aim_speed);
+            move_angle_y = bound(-self.aim_speed, move_angle_y * self.track_accel_rot * f_tmp,self.aim_speed);
+            move_angle = (self.tur_head.avelocity * self.track_blendrate) + (move_angle * (1 - self.track_blendrate));
             break;
 
         case TFL_TRACKTYPE_FLUIDPRECISE:
 
-            real_angle_y = bound(self.aim_speed * -1,real_angle_y ,self.aim_speed);
-            real_angle_x = bound(self.aim_speed * -1,real_angle_x ,self.aim_speed);
+            move_angle_y = bound(-self.aim_speed, move_angle_y, self.aim_speed);
+            move_angle_x = bound(-self.aim_speed, move_angle_x, self.aim_speed);
 
             break;
-
-        case TFL_TRACKTYPE_FLUIDINERTIA:
-
-            f_tmp = self.aim_speed * self.ticrate;
-
-            real_angle_y = bound(self.aim_speed * -1,real_angle_y * self.track_accel_rot * f_tmp,self.aim_speed);
-            real_angle_x = bound(self.aim_speed * -1,real_angle_x * self.track_accel_pitch * f_tmp,self.aim_speed);
-            real_angle = (self.tur_head.avelocity * self.track_blendrate) + (real_angle * (1 - self.track_blendrate));
-
-            self.tur_head.avelocity_z = real_angle_z;
-
-            break;
     }
 
-    // Limit pitch
+    //  pitch
     if (self.track_flags & TFL_TRACK_PITCH)
     {
-        self.tur_head.avelocity_x = real_angle_x;
-        if (self.tur_head.angles_x > 360)
+        self.tur_head.avelocity_x = move_angle_x;
+        if((self.tur_head.angles_x + self.tur_head.avelocity_x * self.ticrate) + a_off_x > self.aim_maxpitch)
         {
-            self.tur_head.angles_x -= floor(self.tur_head.angles_x / 360) * 360;
-            //self.tur_head.angles_x = self.aim_maxpitch;
-            //self.tur_head.avelocity_x = 0;
+            self.tur_head.avelocity_x = 0;
+            self.tur_head.angles_x = a_off_x + self.aim_maxpitch;
         }
-        else if (self.tur_head.angles_x < -360)
+        if((self.tur_head.angles_x + self.tur_head.avelocity_x * self.ticrate) + a_off_x < -self.aim_maxpitch)
         {
-            self.tur_head.angles_x += floor(self.tur_head.angles_x / 360) * 360;
-            //self.tur_head.angles_x = (self.aim_maxpitch * -1);
-            //self.tur_head.avelocity_x = 0;
+            self.tur_head.avelocity_x = 0;
+            self.tur_head.angles_x = a_off_x - self.aim_maxpitch;
         }
+
     }
 
-    // Limit rot
+    //  rot
     if (self.track_flags & TFL_TRACK_ROT)
     {
-        self.tur_head.avelocity_y = real_angle_y;
-        if (self.tur_head.angles_y > 360)
+        self.tur_head.avelocity_y = move_angle_y;
+
+        if(((self.tur_head.angles_y + self.tur_head.avelocity_y * self.ticrate)- a_off_y) > self.aim_maxrot)
         {
-            self.tur_head.angles_y -= floor(self.tur_head.angles_y / 360) * 360;
-            //self.tur_head.angles_y = self.aim_maxrot;
-            //self.tur_head.avelocity_y = 0;
+            self.tur_head.avelocity_y = 0;
+            self.tur_head.angles_y = a_off_y + self.aim_maxrot;
         }
-        else if (self.tur_head.angles_y < -360)
+
+        if(((self.tur_head.angles_y + self.tur_head.avelocity_y * self.ticrate) - a_off_y) < -self.aim_maxrot)
         {
-            self.tur_head.angles_y += floor(self.tur_head.angles_y / 360) * 360;
-            //self.tur_head.angles_y = (self.aim_maxrot * -1);
-            //self.tur_head.avelocity_y = 0;
+            self.tur_head.avelocity_y = 0;
+            self.tur_head.angles_y = a_off_y - self.aim_maxrot;
         }
+
     }
+
 }
 
+
 /*
  + = implemented
  - = not implemented
@@ -400,7 +369,7 @@
     if((self.shoot_flags & TFL_SHOOT_VOLLYALWAYS) && (self.volly_counter != self.shot_volly))
         return 1;
 
-    //
+    // Lack of zombies makes shooting dead things unnecessary :P
     if (self.firecheck_flags & TFL_FIRECHECK_DEAD)
         if (self.enemy.deadflag != DEAD_NO) return 0;
 
@@ -506,7 +475,8 @@
 	// enemy turrets
 	if (validate_flags & TFL_TARGETSELECT_NOTURRETS)
         if (e_target.turret_firefunc || e_target.owner.tur_head == e_target)
-			return -9;
+            if(e_target.team != e_turret.team) // Dont break support units.
+                return -9;
 
     // Missile
     if (e_target.flags & FL_PROJECTILE)
@@ -666,7 +636,8 @@
             {
 
                 load_unit_settings(e,e.cvar_basename,1);
-                e.turret_postthink();
+                if(e.turret_postthink)
+                    e.turret_postthink();
             }
 
             e = nextent(e);
@@ -691,7 +662,7 @@
 
     // Inactive turrets needs to run the think loop,
     // So they can handle animation and wake up if need be.
-    if(!self.tur_active)
+    if not (self.tur_active)
     {
         turret_stdproc_track();
         return;
@@ -700,7 +671,7 @@
     //This is just wrong :|
     if(self.deadflag != DEAD_NO)
     {
-        dprint("Warning:dead turret running the think function!\n");
+        dprint("WARNING: dead turret running the think function!\n");
         return;
     }
 
@@ -727,6 +698,24 @@
         }
         self.enemy = world;
     }
+    else if(self.shoot_flags & TFL_SHOOT_CUSTOM)
+    {
+        // This one is doing something oddball. assume its handles what needs to be handled.
+
+        // Predict?
+        if not((self.aim_flags & TFL_AIM_NO))
+            self.tur_aimpos = turret_stdproc_aim_generic();
+
+        // Turn & pitch?
+        if (!self.track_flags & TFL_TRACK_NO)
+            turret_stdproc_track();
+
+        turret_do_updates(self);
+
+        // Fire?
+        if (self.turret_firecheckfunc())
+            turret_fire();
+    }
     else
     {
         // Special case for volly always. if it fired once it must compleate the volly.
@@ -737,7 +726,6 @@
                 if not((self.aim_flags & TFL_AIM_NO))
                     self.tur_aimpos = turret_stdproc_aim_generic();
 
-
                 // Turn & pitch
                 if (!self.track_flags & TFL_TRACK_NO)
                     turret_stdproc_track();
@@ -748,7 +736,8 @@
                 if (self.turret_firecheckfunc() != 0)
                     turret_fire();
 
-                self.turret_postthink();
+                if(self.turret_postthink)
+                    self.turret_postthink();
 
                 return;
             }
@@ -769,7 +758,8 @@
                 turret_stdproc_track();
 
             // do any per-turret stuff
-            self.turret_postthink();
+            if(self.turret_postthink)
+                self.turret_postthink();
 
             // And bail.
             return;
@@ -777,20 +767,11 @@
         else
             self.lip = time + cvar("g_turrets_aimidle_delay"); // Keep track of the last time we had a target.
 
-
-        /*
-        turret_do_updates(self);
-        if (self.turret_firecheckfunc() > 0)
-            turret_fire();
-        */
-
-        //turret_do_updates(self);
-        // Predict or whatnot
+        // Predict?
         if not((self.aim_flags & TFL_AIM_NO))
             self.tur_aimpos = turret_stdproc_aim_generic();
 
-        //turret_do_updates(self);
-        // Turn & pitch
+        // Turn & pitch?
         if (!self.track_flags & TFL_TRACK_NO)
             turret_stdproc_track();
 
@@ -798,13 +779,11 @@
         // Fire?
         if (self.turret_firecheckfunc())
             turret_fire();
-
-
-
     }
 
     // do any per-turret stuff
-    self.turret_postthink();
+    if(self.turret_postthink)
+        self.turret_postthink();
 }
 
 void turret_fire()
@@ -1132,18 +1111,27 @@
         }
     }
 
-
 // Put pices in place
-    if (!(self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED))
+    if not (self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
         setorigin(self.tur_head,self.origin);
 
-    // In target defense mode, aim on the spot to defens when idle.
-    if (self.tur_defend)
-        self.idle_aim  = self.tur_head.angles + angleofs(self.tur_head,self.tur_defend);
+    // In target defend mode, aim on the spot to defend when idle.
+    if(self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
+    {
+        if (self.tur_defend)
+            self.idle_aim  = self.tur_head.angles + angleofs(self.tur_head,self.tur_defend);
+        else
+            self.idle_aim  = '0 0 0';
+    }
     else
-        self.idle_aim  = self.angles;
+    {
+        if (self.tur_defend)
+            self.idle_aim  = self.tur_head.angles + angleofs(self.tur_head,self.tur_defend);
+        else
+            self.idle_aim  = self.angles;
+    }
 
-    if (!(self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED))
+    if not (self.turrcaps_flags & TFL_TURRCAPS_HEADATTACHED)
         self.tur_head.angles    = self.idle_aim;
 
     if (!self.health)
@@ -1171,7 +1159,8 @@
         self.turret_score_target    = turret_stdproc_targetscore_support;
         self.turret_firecheckfunc   = turret_stdproc_firecheck;
         self.turret_firefunc        = turret_stdproc_fire;
-        self.turret_postthink       = turret_stdproc_nothing;
+        //self.turret_postthink       = turret_stdproc_nothing;
+        self.event_damage           = turret_stdproc_damage;
         self.tur_head.event_damage  = turret_stdproc_damage;
     }
     else
@@ -1179,10 +1168,10 @@
         self.turret_score_target    = turret_stdproc_targetscore_generic;
         self.turret_firecheckfunc   = turret_stdproc_firecheck;
         self.turret_firefunc        = turret_stdproc_fire;
-        self.turret_postthink       = turret_stdproc_nothing;
+        //self.turret_postthink       = turret_stdproc_nothing;
         self.event_damage           = turret_stdproc_damage;
         self.tur_head.event_damage  = turret_stdproc_damage;
-        self.turret_addtarget       = turret_stdproc_false;
+        //self.turret_addtarget       = turret_stdproc_false;
     }
 
     self.use = turret_stdproc_use;

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_misc.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_misc.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/system/system_misc.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,7 +1,21 @@
-//--// Some supptort routines //--//
+//--// Some support routines //--//
 
-#define anglemods(a) (a - floor(a / 360) * 360)
+#define anglemodss(a) (a - floor(a / 360) * 360)
+float(float v) anglemods =
+{
+	v = v - 360 * floor(v / 360);
+	return v;
+};
+float safeangle(float a)
+{
+    if((a > -361) && (a < 361))
+        return a;
 
+    a -= (360 * floor(a / 360));
+
+    return a;
+}
+
 float shortangle_f(float ang1,float ang2)
 {
     if(ang1 > ang2)
@@ -29,6 +43,16 @@
     return vtmp;
 }
 
+vector shortangle_vxy(vector ang1,vector ang2)
+{
+    vector vtmp;
+
+    vtmp_x = shortangle_f(ang1_x,ang2_x);
+    vtmp_y = shortangle_f(ang1_y,ang2_y);
+
+    return vtmp;
+}
+
 // Get real origin
 vector real_origin(entity ent)
 {
@@ -235,15 +259,20 @@
     return v_res;
 }
 
-float turret_tag_setup(float linked)
+float turret_tag_setup()
 {
-    // Laters dooz
-    if (linked)
+    if(!self.tur_head)
+    {
+        dprint("Call to turret_tag_setup with self.tur_head missing!\n");
+        self.tur_shotorg = '0 0 0';
         return 0;
+    }
 
     setorigin(self.tur_head,gettaginfo(self,gettagindex(self,"tag_head")));
     self.tur_shotorg = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
 
+    v_forward = normalize(v_forward);
+
     return 1;
 }
 
@@ -251,11 +280,14 @@
 {
     if(!self.tur_head)
     {
+        dprint("Call to turret_tag_fire_update with self.tur_head missing!\n");
         self.tur_shotorg = '0 0 0';
-        return 1;
+        return 0;
     }
 
     self.tur_shotorg = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
+    v_forward = normalize(v_forward);
+
     //dprint("update: tur_shotorg: ",vtos(self.tur_shotorg)," origin:", vtos(self.tur_head.origin), " angels: ", vtos(self.tur_head.angles),"\n");
 
     return 1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_ewheel.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_ewheel.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_ewheel.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -4,7 +4,7 @@
 
     org2 = findbetterlocation (self.origin, 8);
     pointparticles(particleeffectnum("laser_impact"), org2, trace_plane_normal * 1000, 1);
-
+    //w_deathtypestring = "saw the eweel. to late.";
 #ifdef TURRET_DEBUG
     float d;
 
@@ -61,184 +61,278 @@
 
 }
 
-#define EWHEEL_MASS 25
-#define EWHEEL_MAXSPEED 800
-#define EWHEEL_ACCEL_SLOW 100
-#define EWHEEL_ACCEL_FAST 350
-#define EWHEEL_BREAK_SLOW 150
-#define EWHEEL_BREAK_FAST 250
-#define EWHEEL_DRAG 0.25
-
-void ewheel_enemymove()
+float ewheel_moveverb_path(float eval)
 {
-    vector wish_angle,real_angle,steer,avoid;
-    float turn_limit,angle_ofs;
+    switch (eval)
+    {
+    case VCM_EVAL:
 
-    //steer = steerlib_attract2(point,0.5,2000,0.95);
-    steer = steerlib_pull(self.enemy.origin);
-    avoid = steerlib_traceavoid(0.3,350);
+        if (self.pathcurrent)
+            return verb.verb_static_value;
 
-    wish_angle = normalize(avoid * 0.5 + steer);
-    wish_angle = vectoangles(wish_angle);
-    real_angle = wish_angle - self.angles;
+        return VS_CALL_NO;
+        break;
 
-    if (real_angle_x > self.angles_x)
-    {
-        if (real_angle_x >= 180)
-            real_angle_x -= 360;
+    case VCM_DO:
+        // Do we have a path?
+        if not(self.pathcurrent)
+            return VS_CALL_NO;
+        else
+        {
+            // Are we close enougth to a path node to switch to the next?
+            if (vlen(self.origin  - self.pathcurrent.origin) < 32)
+                if (self.pathcurrent.path_next == world)
+                {
+                    // Path endpoint reached
+                    pathlib_deletepath(self.pathcurrent.owner);
+                    self.pathcurrent = world;
+
+                    if (self.pathgoal)
+                    {
+                        if (self.pathgoal.use)
+                            self.pathgoal.use();
+
+                        if (self.pathgoal.enemy)
+                        {
+                            self.pathcurrent = pathlib_astar(self.pathgoal.origin,self.pathgoal.enemy.origin);
+                            self.pathgoal = self.pathgoal.enemy;
+                        }
+                    }
+                    else
+                        self.pathgoal = world;
+                }
+                else
+                    self.pathcurrent = self.pathcurrent.path_next;
+        }
+
+
+        if (self.pathcurrent)
+        {
+            switch (self.waterlevel)
+            {
+            case 0:
+            case 1:
+            case 2:
+            case 3:
+            }
+
+            self.moveto = self.pathcurrent.origin;
+            self.steerto = steerlib_attract2(self.moveto,0.5,500,0.95);
+
+            self.frame += 1;
+            movelib_move_simple(v_forward,cvar("g_turrets_unit_ewheel_speed_slow"),0.4);
+
+            return VS_CALL_YES_DOING;
+        }
+        else
+            return VS_CALL_YES_DONE;
+
+        break;
+
+    case VCM_REMOVE:
+
+        if (self.pathcurrent)
+            pathlib_deletepath(self.pathcurrent.owner);
+
+        self.pathcurrent = world;
+
+        return VS_CALL_YES_DONE;
+
+        break;
     }
-    else
-    {
-        if (real_angle_x <= -180)
-            real_angle_x += 360;
-    }
 
-    if (real_angle_y > self.tur_head.angles_y)
+    return VS_CALL_YES_DONE;
+}
+
+float ewheel_moveverb_enemy(float eval)
+{
+    switch (eval)
     {
-        if (real_angle_y >= 180)
-            real_angle_y -= 360;
-    }
-    else
-    {
-        if (real_angle_y <= -180)
-            real_angle_y += 360;
-    }
+    case VCM_EVAL:
+            if(self.enemy)
+                return verb.verb_static_value;
 
-    turn_limit = cvar("g_turrets_unit_ewheel_turnrate");
-    // Convert from dgr / sec to dgr / tic
-    turn_limit    = turn_limit / (1 / self.ticrate);
-    angle_ofs     = fabs(real_angle_y);
-    real_angle_y  = bound(turn_limit * -1,real_angle_y,turn_limit);
-    self.angles_y = (self.angles_y + real_angle_y);
+        return VS_CALL_NO;
 
-    // Simulate banking
-    self.angles_z = bound(-45,real_angle_y * -2,45);
+        break;
 
-    if (self.frame > 40)
-        self.frame = 1;
+    case VCM_DO:
 
-    makevectors(self.angles);
-    if (self.tur_dist_aimpos > self.target_range_optimal)
-    {
-        if ( angle_ofs < 1 )
+        self.moveto  = self.enemy.origin;
+        self.steerto = steerlib_arrive(self.enemy.origin,self.target_range_optimal);
+
+        if (self.tur_dist_enemy > self.target_range_optimal)
         {
-            self.frame += 2;
-            movelib_move(v_forward * EWHEEL_ACCEL_FAST,EWHEEL_MAXSPEED,EWHEEL_DRAG,EWHEEL_MASS,0);
+            if ( self.tur_head.spawnshieldtime < 1 )
+            {
+                self.frame += 2;
+                movelib_move_simple(v_forward ,cvar("g_turrets_unit_ewheel_speed_fast"),0.4);
+            }
+            else if (self.tur_head.spawnshieldtime < 2)
+            {
+                self.frame += 1;
+                movelib_move_simple(v_forward,cvar("g_turrets_unit_ewheel_speed_slow"),0.4);
+            }
+            else
+            {
+                self.frame += 1;
+                movelib_move_simple(v_forward,cvar("g_turrets_unit_ewheel_speed_slower"),0.4);
+            }
         }
-        else if (angle_ofs < 2)
+        else if (self.tur_dist_enemy < self.target_range_min)
         {
-            self.frame += 1;
-            movelib_move(v_forward * EWHEEL_ACCEL_SLOW,EWHEEL_MAXSPEED,EWHEEL_DRAG,EWHEEL_MASS,EWHEEL_BREAK_SLOW);
+            self.frame -= 1;
+            movelib_move_simple(v_forward * -1,cvar("g_turrets_unit_ewheel_speed_slow"),0.4);
         }
         else
         {
-            movelib_move('0 0 0',EWHEEL_MAXSPEED,EWHEEL_DRAG,EWHEEL_MASS,EWHEEL_BREAK_FAST);
+            movelib_beak_simple(cvar("g_turrets_unit_ewheel_speed_stop"));
         }
+
+        return VS_CALL_YES_DOING;
     }
-    else
-        movelib_move('0 0 0',EWHEEL_MAXSPEED,EWHEEL_DRAG,EWHEEL_MASS,EWHEEL_BREAK_FAST);
+
+
+    return VS_CALL_YES_DONE;
 }
 
-void ewheel_roammove()
+float ewheel_moveverb_runaway(float eval)
 {
-    movelib_move(v_forward,EWHEEL_MAXSPEED,0,EWHEEL_MASS,EWHEEL_BREAK_SLOW);
-    self.angles_z = 0;
+    switch (eval)
+    {
+    case VCM_EVAL:
+            if(self.enemy)
+            if(self.health < 50)
+                return verb.verb_static_value;
 
-    /*
-    vector wish_angle,real_angle,steer,avoid;
-    float turn_limit,angle_ofs;
-    float dist;
+            return VS_CALL_NO;
+        break;
 
-    return;
+    case VCM_DO:
+        self.steerto = (steerlib_push(self.enemy.origin) * 0.7) + (steerlib_traceavoid_flat(0.3, 500, '0 0 128') * 0.3);
+        self.moveto  = self.origin + self.steerto * 1000;
 
-    dist = vlen(self.origin - self.pos1);
+        self.frame += 2;
+        movelib_move_simple(v_forward ,cvar("g_turrets_unit_ewheel_speed_fast"),0.4);
 
-    //steer = steerlib_attract2(point,0.5,2000,0.95);
-    steer = steerlib_pull(self.pos1);
-    avoid = steerlib_traceavoid(0.3,350);
+        return VS_CALL_YES_DOING;
 
-    wish_angle = normalize(avoid * 0.5 + steer);
-    wish_angle = vectoangles(wish_angle);
-    real_angle = wish_angle - self.angles;
+        break;
+    }
 
-    real_angle_y = shortangle_f(real_angle_y,self.angles_y);
+    return VS_CALL_YES_DONE;
+}
 
-    turn_limit = cvar("g_turrets_unit_ewheel_turnrate");
-    // Convert from dgr/sec to dgr/tic
-    turn_limit  = turn_limit / (1 / self.ticrate);
-    angle_ofs = fabs(real_angle_y);
+float ewheel_moveverb_idle(float eval)
+{
+    switch (eval)
+    {
+    case VCM_EVAL:
+            if(self.enemy)
+                return VS_CALL_NO;
 
-    real_angle_y = bound(turn_limit * -1,real_angle_y,turn_limit);
-    self.angles_y = (self.angles_y + real_angle_y);
+        return verb.verb_static_value;
 
-    self.angles_z = bound(-12,real_angle_y * -1,12);
+        break;
 
-    if(self.frame > 40)
-        self.frame = 1;
+    case VCM_DO:
+        self.moveto = self.origin;
 
-    makevectors(self.angles);
-    float lspeed;
-    lspeed = vlen(self.velocity);
+        if(vlen(self.velocity))
+            movelib_beak_simple(cvar("g_turrets_unit_ewheel_speed_stop"));
 
-    if((dist < 64)||(self.phase < time))
-    {
-        movelib_move('0 0 0',150,0,50,200);
-        self.pos1 = self.origin + v_forward * 256 + randomvec() * 128;
-        self.pos1_z = self.origin_z;
-        self.phase = time + 5;
+        return VS_CALL_YES_DOING;
     }
-    else if(dist < 128)
-    {
-        self.frame += 1;
-        if(lspeed > 100)
-            movelib_move(v_forward * 50,150,0,50,50);
-        else
-            movelib_move(v_forward * 100,150,0,50,0);
-    }
-    else
-    {
-        self.frame += 1;
-        if(angle_ofs > 10)
-            movelib_move(v_forward * 50,150,0,50,50);
-        else
-            movelib_move(v_forward * 250,150,0,50,0);
-    }
-    */
+
+    return VS_CALL_YES_DONE;
 }
 
 void ewheel_postthink()
 {
-    if (self.enemy)
-        ewheel_enemymove();
-    else
-        ewheel_roammove();
+    float vz;
+    vector wish_angle,real_angle;
 
+    vz = self.velocity_z;
+
+    self.angles_x = anglemods(self.angles_x);
+    self.angles_y = anglemods(self.angles_y);
+
+    self.angles_x *= -1;
+    makevectors(self.angles);
+    self.angles_x *= -1;
+
+    wish_angle = normalize(self.steerto);
+    wish_angle = vectoangles(wish_angle);
+    real_angle = wish_angle - self.angles;
+    real_angle = shortangle_vxy(real_angle,self.tur_head.angles);
+
+    self.tur_head.spawnshieldtime = fabs(real_angle_y);
+    real_angle_y  = bound(self.tur_head.aim_speed * -1,real_angle_y,self.tur_head.aim_speed);
+    self.angles_y = (self.angles_y + real_angle_y);
+
+    // Simulate banking
+    self.angles_z = bound(-45,real_angle_y * -2.5,45);
+
+    verbstack_pop(self.verbs_move);
+
+    if (self.frame > 40)
+        self.frame = 1;
+
+    if (self.frame < 1)
+        self.frame = 40;
+
+
+    self.velocity_z = vz;
 }
 
-
 void ewheel_respawnhook()
 {
+    entity e;
+
     setorigin(self,self.pos1);
+
+    if (self.target != "")
+    {
+        e = find(world,targetname,self.target);
+        if (!e)
+        {
+            dprint("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
+            self.target = "";
+        }
+
+        if (e.classname != "turret_checkpoint")
+            dprint("Warning: not a turrret path\n");
+        else
+        {
+            self.pathcurrent = WALKER_PATH(self.origin,e.origin);
+            self.pathgoal = e;
+        }
+    }
 }
 
 void ewheel_diehook()
 {
-}
+    turret_trowgib2(self.origin,self.velocity + v_up * 400,'-0.6 -0.2 -02',self,time + random() * 2 +3);
 
-float ewheel_firecheck()
-{
-    bprint("Firecheck\n");
-    return 1;
+    if (self.pathcurrent)
+        pathlib_deletepath(self.pathcurrent.owner);
+
+    self.pathcurrent = world;
+
+    if (self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
+    {
+        verbstack_flush(self.verbs_move);
+        remove(self.verbs_move);
+    }
+
 }
 
 void turret_ewheel_dinit()
 {
     entity e;
 
-    if (self.netname == "")      self.netname     = "Ewheel Turret";
+    if (self.netname == "")      self.netname     = "eWheel Turret";
 
-    // self.ticrate = 0.05;
-
     if (self.target != "")
     {
         e = find(world,targetname,self.target);
@@ -261,28 +355,23 @@
     self.turret_respawnhook = ewheel_respawnhook;
     self.turret_diehook = ewheel_diehook;
 
-    self.ticrate = 0.05;
     if (turret_stdproc_init("ewheel_std") == 0)
     {
         remove(self);
         return;
     }
-    //self.turret_firecheckfunc = ewheel_firecheck;
 
-    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
+    self.target_select_flags   = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
-    self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
+    self.damage_flags          |= TFL_DMG_DEATH_NOGIBS;
 
-    //self.flags      = FL_CLIENT;
     self.iscreature = TRUE;
     self.movetype   = MOVETYPE_WALK;
-    self.gravity = 0.01;
     self.solid      = SOLID_SLIDEBOX;
     self.takedamage = DAMAGE_AIM;
 
     setmodel(self,"models/turrets/ewheel-base.md3");
     setmodel(self.tur_head,"models/turrets/ewheel-gun1.md3");
-
     setattachment(self.tur_head,self,"tag_head");
 
     self.pos1 = self.origin;
@@ -293,9 +382,36 @@
     self.turret_firefunc  = ewheel_attack;
     self.turret_postthink = ewheel_postthink;
     self.tur_head.frame = 1;
+
+    self.verbs_move = spawn();
+    verbstack_push(self.verbs_move, ewheel_moveverb_idle,   WVM_IDLE,  0);
+    verbstack_push(self.verbs_move, ewheel_moveverb_enemy,  WVM_ENEMY, 0);
+    verbstack_push(self.verbs_move, ewheel_moveverb_path,   WVM_PATH,  0);
+    verbstack_push(self.verbs_move, ewheel_moveverb_runaway,WVM_PANIC,  0);
+
+    // Convert from dgr / sec to dgr / tic
+    self.tur_head.aim_speed = cvar("g_turrets_unit_ewheel_turnrate");
+    self.tur_head.aim_speed = self.tur_head.aim_speed / (1 / self.ticrate);
+
+    if (self.target != "")
+    {
+        e = find(world,targetname,self.target);
+        if (!e)
+        {
+            dprint("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
+            self.target = "";
+        }
+
+        if (e.classname != "turret_checkpoint")
+            dprint("Warning: not a turrret path\n");
+        else
+        {
+            self.pathcurrent = WALKER_PATH(self.origin,e.origin);
+            self.pathgoal = e;
+        }
+    }
 }
 
-
 void spawnfunc_turret_ewheel()
 {
     precache_model ("models/turrets/ewheel-base.md3");

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_flac.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_flac.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_flac.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -45,6 +45,8 @@
 
     // FIXME: tur_impacttime is not accurate enougth, this is a dirty hakk to make flac work.
 
+    //w_deathtypestring = "got caught in the flack.";
+
     if(self.enemy != world)
     if(self.cnt < time)
     if(vlen(self.origin - self.enemy.origin) > self.owner.shot_radius * 0.25)
@@ -100,7 +102,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/flac.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_fusionreactor.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_fusionreactor.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_fusionreactor.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -58,7 +58,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/reactor.md3");
 
-    //if(!turret_tag_setup(0))
+    //if(!turret_tag_setup())
     //    dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     self.tur_head.scale = 0.75;

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hellion.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hellion.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hellion.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -159,6 +159,7 @@
     WriteCoord (MSG_BROADCAST, org2_y);
     WriteCoord (MSG_BROADCAST, org2_z);
 
+    //w_deathtypestring = "could not dodge the twin missiles.";
     self.event_damage = SUB_Null;
     d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, world, self.owner.shot_force, DEATH_TURRET, world);
 
@@ -196,7 +197,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/hellion.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hk.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hk.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_hk.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -363,6 +363,7 @@
     if ((other == self.owner)||(other == self.owner.tur_head))
         return;
 
+    //w_deathtypestring = "got hunted to extinction";
     //vector	org2;
     sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     org2 = findbetterlocation (self.origin, 16);
@@ -443,7 +444,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/hk.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_machinegun.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_machinegun.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_machinegun.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -11,6 +11,7 @@
     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
     fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
 
+    //w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
     te_smallflash(self.tur_shotorg);
     //  trailparticles(self,particleeffectnum("EF_MGTURRETTRAIL"),self.tur_shotorg_updated,trace_endpos);
 
@@ -52,7 +53,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/machinegun.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_mlrs.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_mlrs.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_mlrs.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -77,7 +77,7 @@
     sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
     org2 = findbetterlocation (self.origin, 16);
     pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
-
+    //w_deathtypestring = "dident escape the rocket barrage";
 #ifdef TURRET_DEBUG
     float d;
 
@@ -117,7 +117,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/mlrs.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_phaser.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_phaser.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_phaser.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -60,6 +60,7 @@
     entity oldself;
     oldself = self;
     self = self.owner;
+    //w_deathtypestring = "was phased out of existence";
     FireImoBeam (   self.tur_shotorg,
                     self.tur_shotorg + self.tur_shotdir_updated * self.target_range_fire,
                     '-1 -1 -1' * self.shot_radius,
@@ -124,7 +125,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/phaser.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     self.turret_firecheckfunc = turret_phaser_firecheck;

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_plasma.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_plasma.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_plasma.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -9,30 +9,11 @@
 
 void turret_plasma_postthink()
 {
-
-
     if (self.tur_head.frame != 0)
         self.tur_head.frame = self.tur_head.frame + 1;
 
     if (self.tur_head.frame > 5)
         self.tur_head.frame = 0;
-
-    setsize(self,self.mins,self.maxs);
-    setsize(self.tur_head,self.tur_head.mins,self.tur_head.maxs);
-
-    /*
-    float h;
-    h = self.health / self.tur_health;
-    if(h<0.95)
-    {
-        if( (0.5 + random()) > h)
-        {
-            //bprint("Spark!\n");
-            //void(vector org, vector vel, float howmany) te_spark = #411;
-            te_spark(0.5 * (self.absmin + self.absmax) + (randomvec() * 64),randomvec() * 256,(1 - h) * 50);
-        }
-    }
-    */
 }
 
 void turret_plasma_dual_postthink()
@@ -48,15 +29,12 @@
 {
     entity proj;
 
-    turret_tag_fire_update();
-
     sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
     pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 
     proj                    = spawn ();
     setorigin(proj, self.tur_shotorg);
     setsize(proj, '-1 -1 -1', '1 1 1');
-    //setmodel(proj, "models/elaser.mdl"); // precision set above
     proj.classname       = "plasmabomb";
     proj.owner           = self;
     proj.bot_dodge       = TRUE;
@@ -82,8 +60,6 @@
 {
     entity proj;
 
-    //turret_tag_fire_update();
-
     sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", VOL_BASE, ATTN_NORM);
     proj                    = spawn ();
     setorigin(proj, self.tur_shotorg);
@@ -124,7 +100,7 @@
     WriteByte (MSG_BROADCAST, 155);
 
     self.event_damage = SUB_Null;
-
+    //w_deathtypestring = "ate to much plasma";
 #ifdef TURRET_DEBUG
     float d;
 
@@ -147,9 +123,9 @@
     self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
 
     // How to aim
-    //self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;// | TFL_AIM_ZPREDICT | TFL_AIM_GROUND2;
+    //self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_ZPREDICT | TFL_AIM_GROUND2;
     self.aim_flags      = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE | TFL_AIM_GROUND2;
-    self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL;// | TFL_TURRCAPS_MISSILEKILL;
+    self.turrcaps_flags = TFL_TURRCAPS_RADIUSDMG | TFL_TURRCAPS_MEDPROJ | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
 
     if (turret_stdproc_init("plasma_std") == 0)
     {
@@ -158,8 +134,9 @@
     }
 
     self.damage_flags    |= TFL_DMG_HEADSHAKE;
+
     //self.firecheck_flags |= (TFL_FIRECHECK_AFF | TFL_FIRECHECK_VERIFIED);
-    //  self.firecheck_flags |= TFL_FIRECHECK_AFF;
+    self.firecheck_flags |= TFL_FIRECHECK_AFF;
 
     //self.target_select_flags |= TFL_TARGETSELECT_FOV;
     //self.target_select_fov    = 45;
@@ -167,7 +144,7 @@
     setmodel(self,"models/turrets/base.md3");
     setmodel(self.tur_head,"models/turrets/plasma.md3");
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fireing routine
@@ -204,7 +181,7 @@
     setmodel(self.tur_head,"models/turrets/plasmad.md3");
 
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fireing routine

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_targettrigger.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_targettrigger.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_targettrigger.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -14,7 +14,8 @@
         if (e.turrcaps_flags & TFL_TURRCAPS_RECIVETARGETS)
         {
             self = e;
-            e.turret_addtarget(other,oldself);
+            if(e.turret_addtarget)
+                e.turret_addtarget(other,oldself);
         }
 
         e = find(e, targetname, oldself.target);

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_tessla.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_tessla.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_tessla.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -17,9 +17,8 @@
         if ((e.toasted != 1) && (e != from))
             if (turret_validate_target(self,e,self.target_validate_flags) > 0)
             {
-
-                traceline(from.origin,e.origin,0,from);
-                if (trace_fraction > 0.9)
+                traceline(from.origin,e.origin,MOVE_WORLDONLY,from);
+                if (trace_fraction == 1.0)
                 {
                     d = vlen(e.origin - from.origin);
                     if (d < dd)
@@ -35,7 +34,7 @@
     if (etarget)
     {
         te_smallflash(etarget.origin);
-        te_lightning1(world,from.origin,etarget.origin);
+        te_csqc_lightningarc(from.origin,etarget.origin);
         Damage(etarget,self,self,damage,DEATH_TURRET,etarget.origin,'0 0 0');
         etarget.toasted = 1;
     }
@@ -43,20 +42,34 @@
     return etarget;
 }
 
+float turret_tesla_firecheck()
+{
+    if not (turret_stdproc_firecheck())
+        return 0;
+
+    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
+                                 TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
+
+    self.enemy = turret_select_target();
+
+    if(self.enemy)
+        return 1;
+
+    return 0;
+
+}
+
 void turret_tesla_fire()
 {
     entity e,t;
     float d,r,i;
 
-    if (cvar("g_turrets_nofire") != 0)
-        return;
+    //w_deathtypestring = "discoverd how a tesla coil works";
 
-    if (self.attack_finished_single > time) return;
-
     d = self.shot_dmg;
     r = self.target_range;
     e = spawn();
-    setorigin(e,self.origin + self.tur_shotorg);
+    setorigin(e,self.tur_shotorg);
 
 
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
@@ -71,11 +84,10 @@
                                  TFL_TARGETSELECT_TEAMCHECK;
 
     self.attack_finished_single = time + self.shot_refire;
-    self.ammo = self.ammo - self.shot_dmg;
-    for (i = 0;i < 10;i = i + 1)
+    for (i = 0; i < 10; ++i)
     {
         d *= 0.5;
-        r *= 0.75;
+        r *= 0.85;
         t = toast(t,r,d);
         if (t == world) break;
     }
@@ -90,15 +102,30 @@
 
 void turret_tesla_postthink()
 {
-    turret_tesla_fire();
+    if not (self.tur_active)
+    {
+        self.tur_head.avelocity = '0 0 0';
+        return;
+    }
 
-    self.tur_head.frame = self.tur_head.frame + 1;
+    if(self.ammo < self.shot_dmg)
+    {
+        self.tur_head.avelocity = '0 9 0' * (self.ammo / self.shot_dmg);
+    }
+    else
+    {
+        self.tur_head.avelocity = '0 90 0' * (self.ammo / self.shot_dmg);
 
-    if (self.tur_head.frame >= 11)
-        self.tur_head.frame = 0;
+        if(self.attack_finished_single > time)
+            return;
 
-    if (self.tur_head.avelocity == '0 0 0')
-        self.tur_head.avelocity = '0 35 0';
+        float f;
+        f = (self.ammo / self.ammo_max);
+        f = f*f;
+        if(f > random())
+            if(random() < 0.1)
+                te_csqc_lightningarc(self.tur_shotorg,self.tur_shotorg + (randomvec() * 350));
+    }
 }
 
 
@@ -106,14 +133,17 @@
 {
     if (self.netname == "")      self.netname     = "Tesla Coil";
 
-    self.turrcaps_flags = TFL_TURRCAPS_HITSCAN | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
-    self.target_select_flags = TFL_TARGETSELECT_NO;
-    self.firecheck_flags = TFL_FIRECHECK_REFIRE;
-    self.shoot_flags = TFL_SHOOT_CUSTOM;
-    self.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
-    self.aim_flags = TFL_AIM_NO;
-    self.track_flags = TFL_TRACK_NO;
+    self.turrcaps_flags      = TFL_TURRCAPS_HITSCAN | TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MISSILEKILL;
 
+    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
+                               TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
+
+    self.firecheck_flags     = TFL_FIRECHECK_REFIRE | TFL_FIRECHECK_OWM_AMMO;
+    self.shoot_flags         = TFL_SHOOT_CUSTOM;
+    self.ammo_flags          = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
+    self.aim_flags           = TFL_AIM_NO;
+    self.track_flags         = TFL_TRACK_NO;
+
     if (turret_stdproc_init("tesla_std") == 0)
     {
         remove(self);
@@ -126,11 +156,12 @@
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES |
                                  TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK;
 
-    if (!turret_tag_setup(0))
+    if (!turret_tag_setup())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
-    self.turret_firefunc = turret_stdproc_nothing;
-    self.turret_postthink = turret_tesla_postthink;
+    self.turret_firefunc      = turret_tesla_fire;
+    self.turret_postthink     = turret_tesla_postthink;
+    self.turret_firecheckfunc = turret_tesla_firecheck;
 }
 
 /*QUAKED turret_tesla (0 .5 .8) ?

Modified: branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_walker.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_walker.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/tturrets/units/unit_walker.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,16 +1,16 @@
-#define ANIM_NO 0
-#define ANIM_REVERSE 1
-#define ANIM_WALK 2
-#define ANIM_RUN 3
-#define ANIM_STRAFE_L 4
-#define ANIM_STRAFE_R 5
-#define ANIM_TURN 6
-#define ANIM_JUMP 7
-#define ANIM_LAND 8
-#define ANIM_PAIN 9
-#define ANIM_MEELE 10
-#define ANIM_SWIM 11
-#define ANIM_ROAM 12
+#define ANIM_NO         0
+#define ANIM_REVERSE    1
+#define ANIM_WALK       2
+#define ANIM_RUN        3
+#define ANIM_STRAFE_L   4
+#define ANIM_STRAFE_R   5
+#define ANIM_TURN       6
+#define ANIM_JUMP       7
+#define ANIM_LAND       8
+#define ANIM_PAIN       9
+#define ANIM_MEELE      10
+#define ANIM_SWIM       11
+#define ANIM_ROAM       12
 
 #define WVM_IDLE_UP 25
 #define WVM_IDLE    50
@@ -19,11 +19,12 @@
 #define WVM_ENEMY 2000
 #define WVM_STOP  3000
 #define WVM_DODGE 4000
+#define  WVM_PANIC 10000
 #define walker_verbs_move verbs_move
 
-#define WVA_MINIGUN 1
-#define WVA_ROCKET  10
-#define WVA_MEELE   20
+#define WVA_MINIGUN 100
+#define WVA_ROCKET  500
+#define WVA_MEELE   1000
 #define walker_verbs_attack verbs_attack
 
 #define WVI_IDLE 1
@@ -31,7 +32,6 @@
 #define walker_verbs_idle verbs_idle
 
 .float animflag;
-.entity wkr_props;
 .entity wkr_spawn;
 
 #define WALKER_MIN '-70 -70 5'
@@ -41,6 +41,9 @@
 
 float walker_firecheck()
 {
+    if (self.animflag == ANIM_MEELE)
+        return 0;
+
     return turret_stdproc_firecheck();
 }
 
@@ -51,6 +54,7 @@
     makevectors(self.angles);
     where = self.origin + v_forward * 128;
 
+    //w_deathtypestring = "tried to hug the cute spider thingy.";
     e = findradius(where,64);
     while (e)
     {
@@ -62,16 +66,13 @@
     }
 }
 
-.vector moveto;
-.vector steerto;
 void walker_animate()
 {
-    vector wish_angle,real_angle;
-    float vz;
+    vector real_angle;
+    float  vz;
 
-    wish_angle = self.steerto;
-    real_angle = wish_angle - self.angles;
-    vz = self.velocity_z;
+    real_angle = vectoangles(self.steerto) - self.angles;
+    vz         = self.velocity_z;
 
     if (self.tur_head.frame != 0)
         self.tur_head.frame = self.tur_head.frame +1;
@@ -81,27 +82,30 @@
 
     switch (self.animflag)
     {
+
     case ANIM_NO:
-        if(self.frame != 0)
+        if (self.frame != 0)
             self.frame = 0;
 
         movelib_beak_simple(cvar("g_turrets_unit_walker_speed_stop"));
+
         break;
 
     case ANIM_REVERSE:
         if ((self.frame < 5) || (self.frame > 25))
-            self.frame = 5;
+            self.frame = 25;
 
-        self.frame = self.frame +1;
+        self.frame = self.frame -1;
         movelib_move_simple(v_forward * -1 ,cvar("g_turrets_unit_walker_speed_walk"),0.6);
 
-        if (self.frame > 25)
-            self.frame = 5;
+        if (self.frame < 5)
+            self.frame = 25;
+
         break;
 
     case ANIM_TURN:
 
-        if (self.frame < 30)
+        if ((self.frame < 30) || (self.frame > 55))
             self.frame = 30;
 
         self.frame = self.frame + 1;
@@ -125,6 +129,7 @@
 
         if (self.frame > 25)
             self.frame = 5;
+
         break;
 
     case ANIM_ROAM:
@@ -133,26 +138,30 @@
 
         self.frame = self.frame +1;
 
-        self.angles_y += bound(-15,shortangle_f(real_angle_y,self.angles_y),15);
+        self.angles_y += bound(-5,shortangle_f(real_angle_y,self.angles_y),5);
 
         movelib_move_simple(v_forward ,cvar("g_turrets_unit_walker_speed_roam"),0.5);
 
         if (self.frame > 25)
             self.frame = 5;
+
         break;
 
     case ANIM_SWIM:
-        if (self.frame < 142)
+        if ((self.frame < 142) || (self.frame > 151))
             self.frame = 142;
 
         self.frame = self.frame +1;
+
         self.angles_y += bound(-10,shortangle_f(real_angle_y,self.angles_y),10);
         self.angles_x += bound(-10,shortangle_f(real_angle_x,self.angles_x),10);
+
         movelib_move_simple(v_forward, cvar("g_turrets_unit_walker_speed_swim"),0.3);
         vz = self.velocity_z + sin(time * 4) * 8;
 
         if (self.frame > 151)
             self.frame = 146;
+
         break;
 
     case ANIM_RUN:
@@ -165,10 +174,11 @@
 
         if (self.frame > 25)
             self.frame = 5;
+
         break;
 
     case ANIM_STRAFE_L:
-        if (self.frame < 30)
+        if ((self.frame < 30) || (self.frame > 55))
             self.frame = 30;
 
         self.frame = self.frame + 1;
@@ -180,7 +190,7 @@
         break;
 
     case ANIM_STRAFE_R:
-        if (self.frame < 60)
+        if ((self.frame < 60) || (self.frame > 65))
             self.frame = 60;
 
         self.frame = self.frame + 1;
@@ -193,7 +203,7 @@
         break;
 
     case ANIM_JUMP:
-        if (self.frame < 95)
+        if ((self.frame < 95) || (self.frame > 100))
             self.frame = 95;
 
         self.velocity += '0 0 1' * cvar("g_turrets_unit_walker_speed_jump");
@@ -204,7 +214,7 @@
         break;
 
     case ANIM_LAND:
-        if (self.frame < 100)
+        if ((self.frame < 100) || (self.frame > 107))
             self.frame = 100;
 
         self.frame = self.frame + 1;
@@ -215,7 +225,7 @@
         break;
 
     case ANIM_PAIN:
-        if (self.frame < 60)
+        if ((self.frame < 60) || (self.frame > 95))
             self.frame = 90;
 
         self.frame = self.frame + 1;
@@ -226,11 +236,11 @@
         break;
 
     case ANIM_MEELE:
-        movelib_beak_simple(250);
-
-        if (self.frame < 123)
+        if ((self.frame < 123) || (self.frame > 140))
             self.frame = 123;
 
+        movelib_beak_simple(cvar("g_turrets_unit_walker_speed_stop"));
+
         self.frame = self.frame + 2;
 
         if (self.frame == 133)
@@ -242,9 +252,10 @@
             self.frame = 0;
         }
     }
+
     self.velocity_z = vz;
 
-    if(self.flags & FL_ONGROUND)
+    if (self.flags & FL_ONGROUND)
         movelib_groundalign4point(300,100);
 
 }
@@ -254,7 +265,7 @@
 {
     vector org2;
 
-    if(self.event_damage != SUB_Null)
+    if (self.event_damage != SUB_Null)
     {
         self.event_damage = SUB_Null;
         self.think = walker_rocket_explode;
@@ -266,7 +277,7 @@
     org2 = findbetterlocation (self.origin, 16);
 
     pointparticles(particleeffectnum("rocket_explode"), org2, '0 0 0', 1);
-
+    //w_deathtypestring = "got blasted to oblivion";
     RadiusDamage (self, self.owner, cvar("g_turrets_unit_walker_std_rocket_dmg"), 0, cvar("g_turrets_unit_walker_std_rocket_radius"), world, cvar("g_turrets_unit_walker_std_rocket_force"), DEATH_TURRET, world);
 
     remove (self);
@@ -280,7 +291,7 @@
         walker_rocket_explode();
 }
 
-#define WALKER_ROCKET_MOVE movelib_move_simple(newdir,1000,cvar("g_turrets_unit_walker_std_rocket_tunrate")); UpdateCSQCProjectile(self)
+#define WALKER_ROCKET_MOVE movelib_move_simple(newdir,cvar("g_turrets_unit_walker_std_rocket_speed"),cvar("g_turrets_unit_walker_std_rocket_tunrate")); UpdateCSQCProjectile(self)
 void walker_rocket_loop();
 void walker_rocket_think()
 {
@@ -316,11 +327,11 @@
     }
 
     if (self.shot_dmg != 1337)
-    if (random() < 0.01)
-    {
-        walker_rocket_loop();
-        return;
-    }
+        if (random() < 0.01)
+        {
+            walker_rocket_loop();
+            return;
+        }
 
     m_speed = vlen(self.velocity) + cvar("g_turrets_unit_walker_std_rocket_speed_add");
 
@@ -361,7 +372,6 @@
         return;
     }
 
-
     newdir = steerlib_pull(self.tur_shotorg);
     WALKER_ROCKET_MOVE;
 
@@ -386,6 +396,7 @@
         self.think = walker_rocket_loop3;
         return;
     }
+
     newdir = steerlib_pull(self.tur_shotorg);
     WALKER_ROCKET_MOVE;
 }
@@ -446,7 +457,7 @@
     rocket.solid              = SOLID_BBOX;
     rocket.tur_health         = time + 9;
 
-	CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
+    CSQCProjectile(rocket, FALSE, PROJECTILE_ROCKET, FALSE); // no culling, has fly sound
 }
 
 void rv_think()
@@ -455,7 +466,7 @@
     vector org;
     entity oldself;
 
-    if(self.owner.deadflag != DEAD_NO)
+    if (self.owner.deadflag != DEAD_NO)
     {
         remove(self);
         return;
@@ -483,300 +494,280 @@
     self = oldself;
 }
 
-/*
-void walker_move()
+float walker_moveverb_path(float eval)
 {
-    vector major,minor,f,b,l,r;
-    float lf,lb,lr,ll,bl,tl;
-
-    if(self.animflag == ANIM_MEELE)
-        return;
-
-    tl = vlen(self.origin - self.moveto);
-    switch(self.waterlevel)
+    switch (eval)
     {
-        case 0:
-            self.animflag = ANIM_WALK;
-        case 1:
-        case 2:
-            if(self.animflag == ANIM_WALK)
-                self.animflag = ANIM_WALK;
-            else
-                self.animflag = ANIM_SWIM;
-            break;
-        case 3:
-            self.animflag = ANIM_SWIM;
-    }
+    case VCM_EVAL:
 
-    if(self.animflag == ANIM_SWIM)
-    {
-        self.steerto = vectoangles(steerlib_attract2(self.moveto,0.5,500,0.95));
-        return;
-    }
-
-    if(tl < 250)
-    {
-        self.animflag = ANIM_WALK;
-    }
-    else
-    {
-        self.animflag = ANIM_RUN;
-    }
-
-    self.steerto = vectoangles(steerlib_attract2(self.moveto,0.5,500,0.95));
-    f = self.origin + v_forward;
-    lf = vlen(self.moveto - f);
-    bl = lf;
-    major = v_forward;
-    minor = major;
-
-    b = self.origin - v_forward;
-    lb = vlen(self.moveto - b);
-    if(bl > lb)
-    {
-        minor = major;
-        major = v_forward * -1;
-        bl = lb;
-    }
-
-    r = self.origin + v_right;
-    lr = vlen(self.moveto - r);
-    if(bl > lr)
-    {
-
-        minor = major;
-        major = v_right;
-        bl = lr;
-        self.steerto = vectoangles(v_right);
-        self.animflag = ANIM_STRAFE_R;
-
-    }
-
-    l = self.origin - v_right;
-    ll = vlen(self.moveto - l);
-    if(bl > ll)
-    {
-
-        minor = major;
-        major = v_right * -1;
-        bl = ll;
-        self.steerto = vectoangles(v_right*-1);
-        self.animflag = ANIM_STRAFE_L;
-
-    }
-
-}
-*/
-
-float walker_moveverb_path(float eval)
-{
-    if(eval)
-    {
-        if(self.animflag == ANIM_MEELE)
+        if (self.animflag == ANIM_MEELE)
             return VS_CALL_NO;
 
-        if(self.pathcurrent)
+        if (self.pathcurrent)
             return verb.verb_static_value;
 
         return VS_CALL_NO;
-    }
+        break;
 
-    // Do we have a path?
-    if not(self.pathcurrent)
-    {
-        return VS_CALL_NO;
-    }
-    else
-    {
-        // Are we close enougth to a path node to switch to the next?
-        if (vlen(self.origin  - self.pathcurrent.origin) < 64)
-            if (self.pathcurrent.path_next == world)
-            {
-                // Path endpoint reached
-                pathlib_deletepath(self.pathcurrent.owner);
-                self.pathcurrent = world;
-
-                if(self.pathgoal)
+    case VCM_DO:
+        // Do we have a path?
+        if not(self.pathcurrent)
+        {
+            return VS_CALL_NO;
+        }
+        else
+        {
+            // Are we close enougth to a path node to switch to the next?
+            if (vlen(self.origin  - self.pathcurrent.origin) < 64)
+                if (self.pathcurrent.path_next == world)
                 {
-                    if(self.pathgoal.use)
-                        self.pathgoal.use();
+                    // Path endpoint reached
+                    pathlib_deletepath(self.pathcurrent.owner);
+                    self.pathcurrent = world;
 
-                    if(self.pathgoal.enemy)
+                    if (self.pathgoal)
                     {
-                        self.pathcurrent = WALKER_PATH(self.pathgoal.origin,self.pathgoal.enemy.origin);
-                        self.pathgoal = self.pathgoal.enemy;
+                        if (self.pathgoal.use)
+                            self.pathgoal.use();
+
+                        if (self.pathgoal.enemy)
+                        {
+                            self.pathcurrent = WALKER_PATH(self.pathgoal.origin,self.pathgoal.enemy.origin);
+                            self.pathgoal = self.pathgoal.enemy;
+                        }
                     }
+                    else
+                        self.pathgoal = world;
                 }
                 else
-                    self.pathgoal = world;
-            }
-            else
-                self.pathcurrent = self.pathcurrent.path_next;
-    }
+                    self.pathcurrent = self.pathcurrent.path_next;
+        }
 
 
-    if (self.pathcurrent)
-    {
-        switch(self.waterlevel)
+        if (self.pathcurrent)
         {
+            switch (self.waterlevel)
+            {
             case 0:
                 self.animflag = ANIM_WALK;
             case 1:
             case 2:
-                if(self.animflag == ANIM_WALK)
+                if (self.animflag == ANIM_WALK)
                     self.animflag = ANIM_WALK;
                 else
                     self.animflag = ANIM_SWIM;
                 break;
             case 3:
                 self.animflag = ANIM_SWIM;
+            }
+
+            self.moveto = self.pathcurrent.origin;
+            self.steerto = steerlib_attract2(self.moveto,0.5,500,0.95);
+
+            return VS_CALL_YES_DOING;
         }
+        else
+            return VS_CALL_YES_DONE;
 
-        self.moveto = self.pathcurrent.origin;
-        self.steerto = vectoangles(steerlib_attract2(self.moveto,0.5,500,0.95));
+        break;
 
-        return VS_CALL_YES_DOING;
+    case VCM_REMOVE:
+
+        if (self.pathcurrent)
+            pathlib_deletepath(self.pathcurrent.owner);
+
+        self.pathcurrent = world;
+
+        return VS_CALL_YES_DONE;
+
+        break;
     }
-    else
-        return VS_CALL_YES_DONE;
+
+    return VS_CALL_YES_DONE;
 }
 
 float walker_moveverb_enemy(float eval)
 {
-    if(eval)
+    switch (eval)
     {
-        if(self.animflag == ANIM_MEELE)
+    case VCM_EVAL:
+
+        if (self.animflag == ANIM_MEELE)
             return VS_CALL_NO;
 
-        if(self.enemy == world)
+        if (self.enemy == world)
             return VS_CALL_NO;
 
-        if(tracewalk(self.enemy, self.origin, self.mins, self.maxs, self.enemy.origin, MOVE_NORMAL))
+        if (tracewalk(self.enemy, self.origin, self.mins, self.maxs, self.enemy.origin, MOVE_NORMAL))
             return verb.verb_static_value;
 
         return VS_CALL_NO;
-    }
 
-    switch(self.waterlevel)
-    {
+        break;
+
+    case VCM_DO:
+        switch (self.waterlevel)
+        {
         case 0:
-            if(self.tur_dist_enemy > 500)
+            if (self.tur_dist_enemy > 500)
                 self.animflag = ANIM_RUN;
             else
                 self.animflag = ANIM_WALK;
         case 1:
         case 2:
-            if(self.animflag == ANIM_WALK)
+            if (self.animflag != ANIM_SWIM)
                 self.animflag = ANIM_WALK;
             else
                 self.animflag = ANIM_SWIM;
             break;
         case 3:
             self.animflag = ANIM_SWIM;
+        }
+
+        self.moveto = self.enemy.origin;
+        self.steerto = steerlib_attract2(self.moveto,0.5,500,0.95);
+
+        return VS_CALL_YES_DOING;
+        break;
     }
 
-    self.moveto = self.enemy.origin;
-    self.steerto = vectoangles(steerlib_attract2(self.moveto,0.5,500,0.95));
-
-    return VS_CALL_YES_DOING;
+    return VS_CALL_YES_DONE;
 }
 
 float walker_moveverb_idle_pause(float eval)
 {
-    if(eval)
+    switch (eval)
     {
-        if(self.animflag == ANIM_MEELE)
+    case VCM_EVAL:
+
+        if (self.animflag == ANIM_MEELE)
             return VS_CALL_NO;
 
         return verb.verb_static_value;
+        break;
 
+    case VCM_DO:
+
+        self.moveto   = self.origin;
+        self.steerto  = v_forward;
+        self.animflag = ANIM_NO;
+
+        return VS_CALL_YES_DOING;
+        break;
     }
 
-    self.moveto = self.origin;
-    self.steerto = v_forward;
-    self.animflag = ANIM_NO;
-
-    return VS_CALL_YES_DOING;
+    return VS_CALL_YES_DONE;
 }
 
 float walker_moveverb_idle_roam(float eval)
 {
-    if(eval)
+    switch (eval)
     {
-        if(self.animflag == ANIM_MEELE)
+    case VCM_EVAL:
+
+        if (self.animflag == ANIM_MEELE)
             return VS_CALL_NO;
 
         return verb.verb_static_value;
-    }
+        break;
 
-    vector v;
-    v_x = (random() * 32) - (random() * 32);
-    v_y = (random() * 32) - (random() * 32);
-    v = self.origin + v_forward * 64 + v;
-    self.pos1 = self.pos1 * 0.9 + v * 0.1;
+    case VCM_DO:
+        if(verb.wait < time)
+        {
+            trace_fraction = 0;
+            while(trace_fraction != 1.0)
+            {
+                self.moveto = self.origin + (v_forward * 256);
+                self.moveto += v_right * (random() * 256);
+                self.moveto -= v_right * (random() * 256);
 
-    self.moveto = self.origin + v_forward * 10;
-    v = self.angles;
-    v_y += random() * 15;
-    v_y -= random() * 15;
-    self.steerto = v;
+                tracebox(self.origin+'0 0 64',self.mins,self.maxs,self.moveto + '0 0 64',MOVE_NORMAL,self);
+            }
+            verb.wait = time + 10;
+        }
+        else
+        {
+            if(verb.wait - time < 9)
+                if(vlen(self.moveto - self.origin) < 32)
+                {
+                    verbstack_push(self.walker_verbs_move, walker_moveverb_idle_pause,   WVM_IDLE + WVM_IDLE_UP, random() * (verb.wait - time));
+                    self.animflag = ANIM_NO;
+                    return VS_CALL_REMOVE;
+                }
+        }
 
+        self.steerto = steerlib_attract(self.moveto,256);
+        te_lightning1(self,self.origin + '0 0 64',self.moveto + '0 0 64');
 
-    switch(self.waterlevel)
-    {
+
+
+        switch (self.waterlevel)
+        {
         case 0:
             self.animflag = ANIM_ROAM;
         case 1:
         case 2:
-            if(self.animflag != ANIM_SWIM)
+            if (self.animflag != ANIM_SWIM)
                 self.animflag = ANIM_ROAM;
 
             break;
         case 3:
             self.animflag = ANIM_SWIM;
+        }
+
+        return VS_CALL_YES_DOING;
+
+        break;
     }
 
-    return VS_CALL_YES_DOING;
+    return VS_CALL_YES_DONE;
 }
 
 float walker_moveverb_idle(float eval)
 {
-    if(eval)
+    switch (eval)
     {
-        if(self.animflag == ANIM_MEELE)
+    case VCM_EVAL:
+
+        if (self.animflag == ANIM_MEELE)
             return VS_CALL_NO;
 
         return verb.verb_static_value;
-    }
 
-    if(verb.wait < time)
-    {
-        verb.wait = random() * 10;
+        break;
 
-        if(random() < 0.5)
-            verbstack_push(self.walker_verbs_move, walker_moveverb_idle_pause,   WVM_IDLE + WVM_IDLE_UP, verb.wait);
-        else
-            verbstack_push(self.walker_verbs_move, walker_moveverb_idle_roam,   WVM_IDLE + WVM_IDLE_UP, verb.wait);
+    case VCM_DO:
 
-        verb.wait += time;
+        //if (random() < 0.5)
+            verbstack_push(self.walker_verbs_move, walker_moveverb_idle_pause,   WVM_IDLE + WVM_IDLE_UP, random() * 5);
+        //else
+        //    verbstack_push(self.walker_verbs_move, walker_moveverb_idle_roam,   WVM_IDLE + WVM_IDLE_UP,  random() * 15);
+
+        return VS_CALL_YES_DOING;
+
+        break;
     }
 
-    return VS_CALL_YES_DOING;
+    return VS_CALL_YES_DONE;
 }
+
 float walker_attackverb_meele(float eval)
 {
-    if(eval)
+    switch (eval)
     {
-        if(cvar("g_turrets_nofire"))
+    case VCM_EVAL:
+
+        vector wish_angle;
+
+        if (cvar("g_turrets_nofire"))
             return VS_CALL_NO;
 
-        if(self.animflag == ANIM_SWIM || self.animflag == ANIM_MEELE)
+        if (self.animflag == ANIM_SWIM || self.animflag == ANIM_MEELE)
             return VS_CALL_NO;
 
-        if(!self.enemy)
+        if (!self.enemy)
             return VS_CALL_NO;
 
-        vector wish_angle;
         wish_angle = angleofs(self,self.enemy);
 
         if (self.tur_dist_enemy < cvar("g_turrets_unit_walker_std_meele_range"))
@@ -784,20 +775,28 @@
                 return verb.verb_static_value;
 
         return VS_CALL_NO;
-    }
 
-    self.moveto = self.enemy.origin;
-    self.steerto = vectoangles(steerlib_attract2(self.moveto,0.5,500,0.95));
+        break;
 
-    self.animflag = ANIM_MEELE;
+    case VCM_DO:
 
-    return VS_CALL_YES_DOING;
+        self.moveto   = self.enemy.origin;
+        self.steerto  = steerlib_attract2(self.moveto,0.5,500,0.95);
+        self.animflag = ANIM_MEELE;
+
+        return VS_CALL_YES_DOING;
+
+        break;
+    }
+
+    return VS_CALL_YES_DONE;
 }
 
 float walker_attackverb_rockets(float eval)
 {
-    if(eval)
+    switch (eval)
     {
+    case VCM_EVAL:
         if (self.tur_head.attack_finished_single > time)
             return VS_CALL_NO;
 
@@ -814,19 +813,27 @@
             return VS_CALL_NO;
 
         return verb.verb_static_value;
-    }
 
-    entity rv;
-    rv           = spawn();
-    rv.think     = rv_think;
-    rv.nextthink = time;
-    rv.cnt       = 4;
-    rv.owner     = self;
+        break;
 
-    self.tur_head.attack_finished_single = time + cvar("g_turrets_unit_walker_std_rocket_refire");
+    case VCM_DO:
 
+        entity rv;
+
+        rv           = spawn();
+        rv.think     = rv_think;
+        rv.nextthink = time;
+        rv.cnt       = 4;
+        rv.owner     = self;
+
+        self.tur_head.attack_finished_single = time + cvar("g_turrets_unit_walker_std_rocket_refire");
+
+        return VS_CALL_YES_DONE;
+
+        break;
+    }
+
     return VS_CALL_YES_DONE;
-
 }
 
 void walker_postthink()
@@ -846,33 +853,30 @@
 {
     entity flash;
 
-    //turret_do_updates(self);
-
-    self.tur_head.frame = self.tur_head.frame + 1;
-
+    //w_deathtypestring = "was miniguned";
     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
-
     fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
-    //te_smallflash(self.tur_shotorg_updated);
-
-    if (!(self.uzi_bulletcounter & 3))
+    if (self.uzi_bulletcounter == 2)
     {
 
-        //trailparticles(self,particleeffectnum("EF_MGTURRETTRAIL"),self.tur_shotorg_updated,trace_endpos);
-        // te_lightning1(self,self.tur_shotorg_updated,trace_endpos);
         flash = spawn();
-        setmodel(flash, "models/uziflash.md3"); // precision set below
+
+        setmodel(flash, "models/uziflash.md3");
         setattachment(flash, self.tur_head, "tag_fire");
-        flash.scale = 3;
-        flash.think = W_Uzi_Flash_Go;
+
+        flash.scale     = 3;
+        flash.think     = W_Uzi_Flash_Go;
         flash.nextthink = time + 0.02;
-        flash.frame = 2;
-        flash.angles_z = flash.v_angle_z + random() * 180;
-        flash.alpha = 1;
-        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+        flash.frame     = 2;
+        flash.angles_z  = flash.v_angle_z + random() * 180;
+        flash.alpha     = 1;
+        flash.effects   = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+
+        self.uzi_bulletcounter = self.uzi_bulletcounter = 0;
     }
 
     self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+    self.tur_head.frame    = self.tur_head.frame + 1;
 }
 
 
@@ -882,8 +886,8 @@
     entity e;
 
     self.origin = self.wkr_spawn.origin;
-    self.wkr_props.solid = SOLID_BBOX;
-    self.wkr_props.alpha = 1;
+    //self.wkr_props.solid = SOLID_BBOX;
+    //self.wkr_props.alpha = 1;
 
     self.angles = self.wkr_spawn.angles;
     vtmp = self.wkr_spawn.origin;
@@ -910,18 +914,22 @@
 }
 void walker_diehook()
 {
-    if(self.pathcurrent)
+    turret_trowgib2(self.origin,self.velocity + v_up * 200,'-0.6 -0.2 -02',self,time + random() * 1);
+    turret_trowgib2(self.origin + '0 0 64',self.velocity + v_forward * 150 + v_up * 150,'-0.2 -0.2 -02',self.tur_head,time + random() * 2 + 3);
+
+    if (self.pathcurrent)
         pathlib_deletepath(self.pathcurrent.owner);
 
     self.pathcurrent = world;
 
-    self.wkr_props.solid = SOLID_NOT;
-    self.wkr_props.alpha = -1;
-
-    if(self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
+    if (self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
     {
-        remove(self.wkr_props);
         remove(self.wkr_spawn);
+
+        verbstack_flush(self.walker_verbs_move);
+        verbstack_flush(self.walker_verbs_attack);
+        verbstack_flush(self.walker_verbs_idle);
+
         remove(self.walker_verbs_move);
         remove(self.walker_verbs_attack);
         remove(self.walker_verbs_idle);
@@ -935,15 +943,13 @@
     entity e;
 
     if (self.netname == "")      self.netname     = "Walker Turret";
-
-    self.wkr_props = spawn();
     self.wkr_spawn = spawn();
 
     self.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIVE;
     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL | TFL_TURRCAPS_MOVE | TFL_TURRCAPS_HEADATTACHED;
     self.aim_flags = TFL_AIM_LEAD;
 
-    if(cvar("g_antilag_bullets"))
+    if (cvar("g_antilag_bullets"))
         self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
     else
         self.aim_flags      |= TFL_AIM_SHOTTIMECOMPENSATE;
@@ -963,7 +969,7 @@
     self.walker_verbs_attack = spawn();
     self.walker_verbs_idle   = spawn();
 
-    verbstack_push(self.walker_verbs_move, walker_moveverb_idle,   WVM_IDLE, 0);
+    verbstack_push(self.walker_verbs_move, walker_moveverb_idle,   WVM_IDLE,  0);
     verbstack_push(self.walker_verbs_move, walker_moveverb_enemy,  WVM_ENEMY, 0);
     verbstack_push(self.walker_verbs_move, walker_moveverb_path,   WVM_PATH,  0);
 
@@ -972,10 +978,9 @@
 
     self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
 
-    self.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
-    self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK    | TFL_TARGETSELECT_LOS;
+    //self.target_select_flags   = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
+    //self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
 
-    //self.flags      = FL_CLIENT;
     self.iscreature = TRUE;
     self.movetype   = MOVETYPE_WALK;
     self.solid      = SOLID_SLIDEBOX;
@@ -983,16 +988,14 @@
 
     setmodel(self,"models/turrets/walker_body.md3");
     setmodel(self.tur_head,"models/turrets/walker_head_minigun.md3");
-    setmodel(self.wkr_props,"models/turrets/walker_props.md3");
     setmodel(self.wkr_spawn,"models/turrets/walker_spawn.md3");
-    setorigin(self.wkr_spawn,self.origin);
+
     setattachment(self.tur_head,self,"tag_head");
-    setattachment(self.wkr_props,self,"tag_head");
 
     self.wkr_spawn.angles   = self.angles;
     self.wkr_spawn.solid    = SOLID_NOT;
 
-    traceline(self.wkr_spawn.origin + '0 0 16', self.wkr_spawn.origin - '0 0 10000', MOVE_WORLDONLY, self);
+    traceline(self.origin + '0 0 16', self.origin - '0 0 10000', MOVE_WORLDONLY, self);
     setorigin(self.wkr_spawn,trace_endpos + '0 0 4');
     setorigin(self,self.wkr_spawn.origin);
 
@@ -1020,21 +1023,20 @@
             self.pathgoal = e;
         }
     }
-
-    //self.solid    = SOLID_NOT;
-
 }
 
 
 void spawnfunc_turret_walker()
 {
     g_turrets_common_precash();
+
     precache_model ("models/turrets/walker_head_minigun.md3");
     precache_model ("models/turrets/walker_body.md3");
     precache_model ("models/turrets/walker_props.md3");
     precache_model ("models/turrets/walker_spawn.md3");
     precache_model ( "models/turrets/rocket.md3");
     precache_sound ( "weapons/rocket_impact.wav" );
+
     self.think = turret_walker_dinit;
     self.nextthink = time + 0.5;
 }

Modified: branches/nexuiz-2.0/data/qcsrc/server/verbstack.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/verbstack.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/verbstack.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,21 +1,49 @@
-entity verb;
+/// Some default stacks.
 .entity verbs_idle;
 .entity verbs_attack;
 .entity verbs_move;
 
-.float(float eval) verb_call;
+/// This global gets set to the verb in question each time the stack manager calls verb_call
+entity verb;
+
+/// Execure this verb
+#define VCM_DO     0
+/// Return teh value of this verb. Return VS_CALL_REMOVE to delete it.
+#define VCM_EVAL   1
+/// This verb is beeing removed NOW (not sent when verb_call returns VS_CALL_REMOVE)
+#define VCM_REMOVE 2
+
+/// Verb callback
+.float(float message) verb_call;
+
+/// Points to this verb's stack.
 .entity  verbstack;
+
+/// Static value of this verb
 .float verb_static_value;
 
+/// verb_call returns this when a verb in not doable
 #define VS_CALL_NO        0
+/// verb_call(VCM_DO) returns this when a verb is executing
 #define VS_CALL_YES_DOING -1
+/// verb_call(VCM_DO) returns this when a verb did execure and is done
 #define VS_CALL_YES_DONE  -2
+/// verb_call(VCM_DO) returns this when a verb should be deleted by the stack manager
 #define VS_CALL_REMOVE    -3
 
+/**
+    Push a new verb onto the specified stack. Set vrb_life to make it time-limited.
+**/
 entity verbstack_push(entity stack, float(float eval) vrb_call, float val_static, float vrb_life)
 {
     entity vrb;
 
+    if not(stack)
+        return world;
+
+    if not(vrb_call)
+        return world;
+
     vrb                   = spawn();
     vrb.owner             = self;
     vrb.verbstack         = stack;
@@ -31,43 +59,48 @@
     return vrb;
 }
 
+/**
+    Find the best verb in this stack and execurte it.
+    ALso remove any verbs returning VS_CALL_REMOVE on VCM_EVAL or VCM_DO
+**/
 float verbstack_pop(entity stack)
 {
-    entity vrb;
-    entity bestverb,oldself;
-    float value,bestvalue;
+    entity vrb, bestverb, oldself;
+    float  value, bestvalue;
 
     oldself = self;
 
     vrb = findchainentity(verbstack,stack);
     while(vrb)
     {
-        verb = vrb;
-        self = vrb.owner;
-        value = vrb.verb_call(TRUE);
+        verb  = vrb;
+        vrb   = vrb.chain;
+        self  = verb.owner;
+        value = verb.verb_call(VCM_EVAL);
+
         if(value < 0)
         {
             if(value == VS_CALL_REMOVE)
-                remove(vrb);
+                remove(verb);
         }
         else
         {
             if(value > bestvalue)
             {
-                bestverb = vrb;
+                bestverb  = verb;
                 bestvalue = value;
             }
         }
-        vrb = vrb.chain;
     }
 
     if(bestverb)
     {
-        verb = bestverb;
-        self = verb.owner;
-        value = bestverb.verb_call(FALSE);
-            if(value == VS_CALL_REMOVE)
-                remove(bestverb);
+        verb  = bestverb;
+        self  = verb.owner;
+        value = verb.verb_call(VCM_DO);
+
+        if(value == VS_CALL_REMOVE)
+            remove(bestverb);
     }
 
     self = oldself;
@@ -75,11 +108,15 @@
     return value;
 }
 
+/**
+    Find the best verb in this stack and return it.
+    ALso remove any verbs returning VS_CALL_REMOVE on VCM_EVAL.
+**/
 entity verbstack_pull(entity stack)
 {
     entity vrb;
-    entity bestverb,oldself;
-    float value,bestvalue;
+    entity bestverb, oldself;
+    float  value, bestvalue;
 
     oldself = self;
 
@@ -87,25 +124,50 @@
     while(vrb)
     {
         self = vrb.owner;
-        verb = vrb;
-        value = vrb.verb_call(TRUE);
+
+        verb  = vrb;
+        vrb   = vrb.chain;
+        value = verb.verb_call(VCM_EVAL);
+
         if(value > 0)
         {
             if(value == VS_CALL_REMOVE)
-                remove(vrb);
+                remove(verb);
         }
         else
         {
             if(value > bestvalue)
             {
-                bestverb = vrb;
+                bestverb = verb;
                 bestvalue = value;
             }
         }
-        vrb =vrb.chain;
     }
 
     self = oldself;
 
     return bestverb;
 }
+
+/**
+    Delete every verb on this stack, signaling them with VCM_REMOVE first.
+**/
+void verbstack_flush(entity stack)
+{
+    entity vrb, oldself;
+
+    oldself = self;
+
+    vrb = findchainentity(verbstack,stack);
+    while(vrb)
+    {
+        self = vrb.owner;
+
+        verb = vrb;
+        vrb  = vrb.chain;
+        verb.verb_call(VCM_REMOVE);
+        remove(verb);
+    }
+
+    self = oldself;
+}

Modified: branches/nexuiz-2.0/data/qcsrc/server/vote.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/vote.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/vote.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -159,7 +159,7 @@
 			}
 		} else if(argv(1) == "call") {
 			if(!e || cvar("sv_vote_call")) {
-				if(cvar("sv_vote_nospectators") && e.classname != "player") {
+				if(cvar("sv_vote_nospectators") && e && e.classname != "player") {
 					print_to(e, "^1Error: Only players can call a vote."); // TODO invent a cvar name for allowing votes by spectators during warmup anyway
 				}
 				else if(timeoutStatus) { //don't allow a vote call during a timeout

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_hook.qc	2009-03-27 18:16:42 UTC (rev 6333)
@@ -111,7 +111,7 @@
 	}
 	else if (req == WR_THINK)
 	{
-		if (self.BUTTON_ATCK || self.BUTTON_HOOK)
+		if (self.BUTTON_ATCK || (!g_jetpack && self.BUTTON_HOOK))
 		{
 			if(!self.hook)
 			if not(self.hook_state & HOOK_WAITING_FOR_RELEASE)
@@ -154,17 +154,19 @@
 			{
 				if ( time > self.hook_time_ammodecrease )
 				{
-					if ( self.ammo_cells >= 1 )
+					if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 					{
-						if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-							self.ammo_cells -= 1;
-						self.hook_time_ammodecrease = time + hooked_ammodecrease_delay;
+						if ( self.ammo_cells >= frametime / hooked_ammodecrease_delay )
+						{
+							self.ammo_cells -= frametime / hooked_ammodecrease_delay;
+							// decrease next frame again
+						}
+						else
+						{
+							self.hook_state |= HOOK_REMOVING;
+							W_SwitchWeapon_Force(self, w_getbestweapon(self));
+						}
 					}
-					else
-					{
-						self.hook_state |= HOOK_REMOVING;
-						W_SwitchWeapon_Force(self, w_getbestweapon(self));
-					}
 				}
 			}
 		}
@@ -177,7 +179,7 @@
 		if (self.BUTTON_CROUCH)
 		{
 			self.hook_state &~= HOOK_PULLING;
-			if (self.BUTTON_ATCK || self.BUTTON_HOOK)
+			if (self.BUTTON_ATCK || (!g_jetpack && self.BUTTON_HOOK))
 				self.hook_state &~= HOOK_RELEASING;
 			else
 				self.hook_state |= HOOK_RELEASING;
@@ -187,7 +189,7 @@
 			self.hook_state |= HOOK_PULLING;
 			self.hook_state &~= HOOK_RELEASING;
 
-			if (self.BUTTON_ATCK || self.BUTTON_HOOK)
+			if (self.BUTTON_ATCK || (!g_jetpack && self.BUTTON_HOOK))
 			{
 				// already fired
 				if(self.hook)

Modified: branches/nexuiz-2.0/data/scripts/entities.def
===================================================================
--- branches/nexuiz-2.0/data/scripts/entities.def	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/scripts/entities.def	2009-03-27 18:16:42 UTC (rev 6333)
@@ -908,7 +908,7 @@
 NOTOUCH: the trigger can only be triggered by other entities, not by touching or firing (you should probably use trigger_relay or trigger_delay instead)
 */
 
-/*QUAKED trigger_push (1 .5 0) ? 
+/*QUAKED trigger_push (1 .5 0) ? - - INVERT_TEAM
 Jump pad. What else?
 Can be used in three ways:
 Nexuiz "target/height" way: put the target_position where the player should land, and tune height to get a nice jump path. A good starting value for height is 100.
@@ -920,6 +920,10 @@
 movedir: when target is not set, direction vector to push to
 speed: speed of jump pad (default: 1000)
 noise: sound to play when jump pad is used; default is misc/jumppad.wav; you can set it to "" to make the pad silent
+team: team that owns this jump pad (5 = red, 14 = blue, etc) (when set, only this team can teleport)
+targetname: when targeted by a func_button, pressing the button will reassign the teleporter to the team of the activator.
+-------- SPAWNFLAGS --------
+INVERT_TEAM: the team that owns the teleporter will NOT jump when touching this
 */
 
 /*QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) 
@@ -945,11 +949,15 @@
 swamp_slowdown: amount of slowdown caused by the swamp (default is 0.5)
 */
 
-/*QUAKED trigger_teleport (.5 .5 .5) ? 
+/*QUAKED trigger_teleport (.5 .5 .5) ? - - INVERT_TEAM
 Touching this will teleport players to the location of the targeted misc_teleporter_dest entity.
 Note that in Nexuiz, teleporters preserve momentum of the player using them.
 -------- KEYS --------
 target: this must point to a misc_teleporter_dest entity. If it points to more than one, a destination is randomly selected on teleport.
+team: team that owns this teleporter (5 = red, 14 = blue, etc) (when set, only this team can teleport)
+targetname: when targeted by a func_button, pressing the button will reassign the teleporter to the team of the activator.
+-------- SPAWNFLAGS --------
+INVERT_TEAM: the team that owns the teleporter will NOT teleport when touching this
 */
 
 /*QUAKED weapon_crylink (1 0 .5) (-30 -30 0) (30 30 32) FLOATING

Copied: branches/nexuiz-2.0/data/sound/misc/jetpack_fly.ogg (from rev 6332, trunk/data/sound/misc/jetpack_fly.ogg)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/textures/pickups.tga (from rev 6332, trunk/data/textures/pickups.tga)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/textures/pickups_bump.tga (from rev 6332, trunk/data/textures/pickups_bump.tga)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/textures/pickups_gloss.tga (from rev 6332, trunk/data/textures/pickups_gloss.tga)
===================================================================
(Binary files differ)

Copied: branches/nexuiz-2.0/data/textures/pickups_glow.tga (from rev 6332, trunk/data/textures/pickups_glow.tga)
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/unit_ewheel.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_ewheel.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_ewheel.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -2,22 +2,27 @@
 set g_turrets_unit_ewheel_std_respawntime 30
 
 // dgr / sec
-set g_turrets_unit_ewheel_turnrate 240
+set g_turrets_unit_ewheel_turnrate 200
 
-set g_turrets_unit_ewheel_std_shot_dmg 15
-set g_turrets_unit_ewheel_std_shot_refire 0.2
-set g_turrets_unit_ewheel_std_shot_spread 0.015
+set g_turrets_unit_ewheel_speed_fast   500
+set g_turrets_unit_ewheel_speed_slow   150
+set g_turrets_unit_ewheel_speed_slower 50
+set g_turrets_unit_ewheel_speed_stop   25
+
+set g_turrets_unit_ewheel_std_shot_dmg 20
+set g_turrets_unit_ewheel_std_shot_refire 0.1
+set g_turrets_unit_ewheel_std_shot_spread 0.025
 set g_turrets_unit_ewheel_std_shot_force 	50
 set g_turrets_unit_ewheel_std_shot_radius 50
-set g_turrets_unit_ewheel_std_shot_speed 5000
+set g_turrets_unit_ewheel_std_shot_speed 3000
 
 set g_turrets_unit_ewheel_std_shot_volly 2
-set g_turrets_unit_ewheel_std_shot_volly_refire 0.6
+set g_turrets_unit_ewheel_std_shot_volly_refire 1
 
 set g_turrets_unit_ewheel_std_target_range 5000
 set g_turrets_unit_ewheel_std_target_range_fire 3500
 set g_turrets_unit_ewheel_std_target_range_optimal 900
-set g_turrets_unit_ewheel_std_target_range_min 50
+set g_turrets_unit_ewheel_std_target_range_min 0.1
 
 set g_turrets_unit_ewheel_std_target_select_rangebias 0.25
 set g_turrets_unit_ewheel_std_target_select_samebias 2
@@ -29,8 +34,7 @@
 set g_turrets_unit_ewheel_std_ammo 500
 set g_turrets_unit_ewheel_std_ammo_recharge 50
 
-set g_turrets_unit_ewheel_std_aim_firetolerance_dist 200
-set g_turrets_unit_ewheel_std_aim_firetolerance_angle 16
+set g_turrets_unit_ewheel_std_aim_firetolerance_dist 150
 set g_turrets_unit_ewheel_std_aim_speed 90
 set g_turrets_unit_ewheel_std_aim_maxrot 20
 set g_turrets_unit_ewheel_std_aim_maxpitch 45

Modified: branches/nexuiz-2.0/data/unit_flac.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_flac.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_flac.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -5,7 +5,7 @@
 set g_turrets_unit_flac_std_shot_refire 0.2
 set g_turrets_unit_flac_std_shot_radius 150
 set g_turrets_unit_flac_std_shot_speed 2500
-set g_turrets_unit_flac_std_shot_spread 0.05
+set g_turrets_unit_flac_std_shot_spread 0.015
 set g_turrets_unit_flac_std_shot_force 15
 set g_turrets_unit_flac_std_shot_volly 0
 set g_turrets_unit_flac_std_shot_volly_refire 0
@@ -22,16 +22,15 @@
 set g_turrets_unit_flac_std_target_select_missilebias 1
 
 set g_turrets_unit_flac_std_ammo_max 1000
-set g_turrets_unit_flac_std_ammo 500
+set g_turrets_unit_flac_std_ammo 400
 set g_turrets_unit_flac_std_ammo_recharge 100
 
 set g_turrets_unit_flac_std_aim_firetolerance_dist 150
-set g_turrets_unit_flac_std_aim_firetolerance_angle 5
 set g_turrets_unit_flac_std_aim_speed 360
 set g_turrets_unit_flac_std_aim_maxrot 360
 set g_turrets_unit_flac_std_aim_maxpitch 35
 
 set g_turrets_unit_flac_std_track_type 3
 set g_turrets_unit_flac_std_track_accel_pitch 0.25
-set g_turrets_unit_flac_std_track_accel_rot 0.5
-set g_turrets_unit_flac_std_track_blendrate 0.25
+set g_turrets_unit_flac_std_track_accel_rot 0.8
+set g_turrets_unit_flac_std_track_blendrate 0.6

Modified: branches/nexuiz-2.0/data/unit_fusreac.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_fusreac.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_fusreac.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -2,13 +2,13 @@
 set g_turrets_unit_fusreac_std_respawntime 90
 
 set g_turrets_unit_fusreac_std_shot_speed 1
-set g_turrets_unit_fusreac_std_shot_dmg 50
+set g_turrets_unit_fusreac_std_shot_dmg 25
 set g_turrets_unit_fusreac_std_shot_refire 0.1
 
 set g_turrets_unit_fusreac_std_target_range 1024
 set g_turrets_unit_fusreac_std_target_range_min 1
 set g_turrets_unit_fusreac_std_target_range_fire 1024
 
-set g_turrets_unit_fusreac_std_ammo_max 250
+set g_turrets_unit_fusreac_std_ammo_max 300
 set g_turrets_unit_fusreac_std_ammo 0
-set g_turrets_unit_fusreac_std_ammo_recharge 250
+set g_turrets_unit_fusreac_std_ammo_recharge 150

Modified: branches/nexuiz-2.0/data/unit_hellion.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_hellion.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_hellion.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -30,7 +30,6 @@
 set g_turrets_unit_hellion_std_ammo_recharge 50
 
 set g_turrets_unit_hellion_std_aim_firetolerance_dist 200
-set g_turrets_unit_hellion_std_aim_firetolerance_angle 25
 set g_turrets_unit_hellion_std_aim_speed 100
 set g_turrets_unit_hellion_std_aim_maxrot 360
 set g_turrets_unit_hellion_std_aim_maxpitch 20

Modified: branches/nexuiz-2.0/data/unit_hk.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_hk.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_hk.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -32,8 +32,7 @@
 set g_turrets_unit_hk_std_ammo 120
 set g_turrets_unit_hk_std_ammo_recharge 16
 
-set g_turrets_unit_hk_std_aim_firetolerance_dist 250
-set g_turrets_unit_hk_std_aim_firetolerance_angle 25
+set g_turrets_unit_hk_std_aim_firetolerance_dist 500
 set g_turrets_unit_hk_std_aim_speed 100
 set g_turrets_unit_hk_std_aim_maxrot 360
 set g_turrets_unit_hk_std_aim_maxpitch 20	

Modified: branches/nexuiz-2.0/data/unit_machinegun.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_machinegun.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_machinegun.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,19 +1,19 @@
 set g_turrets_unit_machinegun_std_health 256	
 set g_turrets_unit_machinegun_std_respawntime 60
 
-set g_turrets_unit_machinegun_std_shot_dmg 30
-set g_turrets_unit_machinegun_std_shot_refire 0.2
+set g_turrets_unit_machinegun_std_shot_dmg 10
+set g_turrets_unit_machinegun_std_shot_refire 0.1
 set g_turrets_unit_machinegun_std_shot_spread 0.015
 set g_turrets_unit_machinegun_std_shot_force 20
 set g_turrets_unit_machinegun_std_shot_radius 0
 set g_turrets_unit_machinegun_std_shot_speed 34920
-set g_turrets_unit_machinegun_std_shot_volly 0
-set g_turrets_unit_machinegun_std_shot_volly_refire 0.6
+set g_turrets_unit_machinegun_std_shot_volly 6
+set g_turrets_unit_machinegun_std_shot_volly_refire 1
 
 set g_turrets_unit_machinegun_std_target_range 4500
 set g_turrets_unit_machinegun_std_target_range_min 2
-set g_turrets_unit_machinegun_std_target_range_fire 4000
-set g_turrets_unit_machinegun_std_target_range_optimal 2500
+set g_turrets_unit_machinegun_std_target_range_fire 3000
+set g_turrets_unit_machinegun_std_target_range_optimal 1000
 
 set g_turrets_unit_machinegun_std_target_select_rangebias 0.25
 set g_turrets_unit_machinegun_std_target_select_samebias 0.25
@@ -25,15 +25,14 @@
 set g_turrets_unit_machinegun_std_ammo 300
 set g_turrets_unit_machinegun_std_ammo_recharge 75
 
-set g_turrets_unit_machinegun_std_aim_firetolerance_dist 80
-set g_turrets_unit_machinegun_std_aim_firetolerance_angle 16
-set g_turrets_unit_machinegun_std_aim_speed 240
-set g_turrets_unit_machinegun_std_aim_maxrot 400
+set g_turrets_unit_machinegun_std_aim_firetolerance_dist 70
+set g_turrets_unit_machinegun_std_aim_speed 200
+set g_turrets_unit_machinegun_std_aim_maxrot 360
 set g_turrets_unit_machinegun_std_aim_maxpitch 25
 
 set g_turrets_unit_machinegun_std_track_type 3
 set g_turrets_unit_machinegun_std_track_accel_pitch 0.25
-set g_turrets_unit_machinegun_std_track_accel_rot 0.5
-set g_turrets_unit_machinegun_std_track_blendrate 0.2
+set g_turrets_unit_machinegun_std_track_accel_rot 0.8
+set g_turrets_unit_machinegun_std_track_blendrate 0.3
 
 

Modified: branches/nexuiz-2.0/data/unit_mlrs.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_mlrs.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_mlrs.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -27,12 +27,11 @@
 set g_turrets_unit_mlrs_std_ammo_recharge 35
 
 set g_turrets_unit_mlrs_std_aim_firetolerance_dist 125
-set g_turrets_unit_mlrs_std_aim_firetolerance_angle 5
-set g_turrets_unit_mlrs_std_aim_speed 120
+set g_turrets_unit_mlrs_std_aim_speed 125
 set g_turrets_unit_mlrs_std_aim_maxrot 360
 set g_turrets_unit_mlrs_std_aim_maxpitch 15
 
 set g_turrets_unit_mlrs_std_track_type 3
 set g_turrets_unit_mlrs_std_track_accel_pitch 0.25
-set g_turrets_unit_mlrs_std_track_accel_rot 0.5
-set g_turrets_unit_mlrs_std_track_blendrate 0.25
\ No newline at end of file
+set g_turrets_unit_mlrs_std_track_accel_rot 0.8
+set g_turrets_unit_mlrs_std_track_blendrate 0.3
\ No newline at end of file

Modified: branches/nexuiz-2.0/data/unit_phaser.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_phaser.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_phaser.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -24,12 +24,11 @@
 
 set g_turrets_unit_phaser_std_ammo_max 2000
 set g_turrets_unit_phaser_std_ammo 1000
-set g_turrets_unit_phaser_std_ammo_recharge 100
+set g_turrets_unit_phaser_std_ammo_recharge 25
 
 set g_turrets_unit_phaser_std_aim_firetolerance_dist 100
-set g_turrets_unit_phaser_std_aim_firetolerance_angle 20
 
-set g_turrets_unit_phaser_std_aim_speed 100
+set g_turrets_unit_phaser_std_aim_speed 150
 set g_turrets_unit_phaser_std_aim_maxrot 360
 set g_turrets_unit_phaser_std_aim_maxpitch 30
 

Modified: branches/nexuiz-2.0/data/unit_plasma.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_plasma.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_plasma.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -9,20 +9,20 @@
 set g_turrets_unit_plasma_std_shot_radius 150
 //Traveling at this speed
 set g_turrets_unit_plasma_std_shot_speed 2000
-//With a random direction of
+//With a random spread of
 set g_turrets_unit_plasma_std_shot_spread 0.015
 //Pushing things this hard
 set g_turrets_unit_plasma_std_shot_force 100
-//Each volly is this many shots
+//Each volly is this many shots (0=1)
 set g_turrets_unit_plasma_std_shot_volly 0
-// Refire upon compleated volly
+// Refire time upon compleated volly
 set g_turrets_unit_plasma_std_shot_volly_refire 0
 
 // Scan for targets within this range
 set g_turrets_unit_plasma_std_target_range 3500
 // But no close then this
 set g_turrets_unit_plasma_std_target_range_min 200
-// If thise or closer, fire
+// If this or closer, fire
 set g_turrets_unit_plasma_std_target_range_fire 3000
 // If we have a choise, prefer the ones closer to this distance
 set g_turrets_unit_plasma_std_target_range_optimal 500
@@ -38,22 +38,20 @@
 set g_turrets_unit_plasma_std_target_select_playerbias 1
 set g_turrets_unit_plasma_std_target_select_missilebias 0
 
-// Can catty this mutch ammo. one dmg = one ammo
-set g_turrets_unit_plasma_std_ammo_max 800
+// Can carry this mutch ammo. one dmg = one ammo
+set g_turrets_unit_plasma_std_ammo_max 640
 // Start with this mutch ammo
-set g_turrets_unit_plasma_std_ammo 400
+set g_turrets_unit_plasma_std_ammo 320
 // Regain ammo this fast (per sec)
 set g_turrets_unit_plasma_std_ammo_recharge 40
 
 // If predicted emeypos is this or closer to predicted impact, fire is ok
 set g_turrets_unit_plasma_std_aim_firetolerance_dist 100
-// If angle ofset to predicted emeypos is this or less, fire is ok
-set g_turrets_unit_plasma_std_aim_firetolerance_angle 5
-// Aim how fast (for g_turrets_unit_plasma_std_track_type=1 this is dgr/sec, for 2 & 3 its the maximum force added each sec)
+// Aim how fast. for track_type 1 this is dgr/sec, for 2 & 3 its the maximum angle speed added each second
 set g_turrets_unit_plasma_std_aim_speed 200
 // Max rottation of head
-set g_turrets_unit_plasma_std_aim_maxrot 360
-// Max tilt of head
+set g_turrets_unit_plasma_std_aim_maxrot 360	
+// Max pitch  of head
 set g_turrets_unit_plasma_std_aim_maxpitch 30
 
 // How the head turns. 
@@ -63,6 +61,6 @@
 set g_turrets_unit_plasma_std_track_type 3
 // Following controls how _track_type = 3 works.
 set g_turrets_unit_plasma_std_track_accel_pitch 0.25
-set g_turrets_unit_plasma_std_track_accel_rot 0.75
-set g_turrets_unit_plasma_std_track_blendrate 0.2
+set g_turrets_unit_plasma_std_track_accel_rot 0.8
+set g_turrets_unit_plasma_std_track_blendrate 0.4
 

Modified: branches/nexuiz-2.0/data/unit_plasma2.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_plasma2.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_plasma2.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -22,19 +22,18 @@
 set g_turrets_unit_plasma_dual_target_select_playerbias 1
 set g_turrets_unit_plasma_dual_target_select_missilebias 0
 
-set g_turrets_unit_plasma_dual_ammo_max 800
-set g_turrets_unit_plasma_dual_ammo 500
-set g_turrets_unit_plasma_dual_ammo_recharge 64
+set g_turrets_unit_plasma_dual_ammo_max 640
+set g_turrets_unit_plasma_dual_ammo 320
+set g_turrets_unit_plasma_dual_ammo_recharge 40
 
 set g_turrets_unit_plasma_dual_aim_firetolerance_dist 300
-set g_turrets_unit_plasma_dual_aim_firetolerance_angle 16
 
-set g_turrets_unit_plasma_dual_aim_speed 100
+set g_turrets_unit_plasma_dual_aim_speed 150
 set g_turrets_unit_plasma_dual_aim_maxrot 360
 set g_turrets_unit_plasma_dual_aim_maxpitch 30
 
 set g_turrets_unit_plasma_dual_track_type 3
 set g_turrets_unit_plasma_dual_track_accel_pitch 0.25
-set g_turrets_unit_plasma_dual_track_accel_rot 0.25
-set g_turrets_unit_plasma_dual_track_blendrate 0.25
+set g_turrets_unit_plasma_dual_track_accel_rot 0.8
+set g_turrets_unit_plasma_dual_track_blendrate 0.4
 

Modified: branches/nexuiz-2.0/data/unit_tesla.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_tesla.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_tesla.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -2,17 +2,19 @@
 set g_turrets_unit_tesla_std_respawntime 120
 
 set g_turrets_unit_tesla_std_shot_dmg 100
-set g_turrets_unit_tesla_std_shot_refire 0.5
+set g_turrets_unit_tesla_std_shot_refire 1
 set g_turrets_unit_tesla_std_shot_force 400
 
 set g_turrets_unit_tesla_std_shot_volly 1
 set g_turrets_unit_tesla_std_shot_volly_refire 2.5
 
-set g_turrets_unit_tesla_std_target_range 1024
+set g_turrets_unit_tesla_std_target_range_min 0
+set g_turrets_unit_tesla_std_target_range      1000
+set g_turrets_unit_tesla_std_target_range_fire 1000
 
 set g_turrets_unit_tesla_std_target_select_playerbias 1
 set g_turrets_unit_tesla_std_target_select_missilebias 1
 
-set g_turrets_unit_tesla_std_ammo_max 5000
-set g_turrets_unit_tesla_std_ammo 2500
-set g_turrets_unit_tesla_std_ammo_recharge 100
+set g_turrets_unit_tesla_std_ammo_max 1000
+set g_turrets_unit_tesla_std_ammo 200
+set g_turrets_unit_tesla_std_ammo_recharge 15

Modified: branches/nexuiz-2.0/data/unit_walker.cfg
===================================================================
--- branches/nexuiz-2.0/data/unit_walker.cfg	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/data/unit_walker.cfg	2009-03-27 18:16:42 UTC (rev 6333)
@@ -1,23 +1,23 @@
 set g_turrets_unit_walker_std_health 500	
 set g_turrets_unit_walker_std_respawntime 60
 
-set g_turrets_unit_walker_speed_run  350
+set g_turrets_unit_walker_speed_run  300
 set g_turrets_unit_walker_speed_roam 100
-set g_turrets_unit_walker_speed_walk 250
-set g_turrets_unit_walker_speed_swim 250
-set g_turrets_unit_walker_speed_jump 790
-set g_turrets_unit_walker_speed_stop 200
+set g_turrets_unit_walker_speed_walk 200
+set g_turrets_unit_walker_speed_swim 200
+set g_turrets_unit_walker_speed_jump 800
+set g_turrets_unit_walker_speed_stop 90
 
 // Main machineguns prop's
-set g_turrets_unit_walker_std_shot_dmg 6
+set g_turrets_unit_walker_std_shot_dmg 5
 set g_turrets_unit_walker_std_shot_refire 0.05
-set g_turrets_unit_walker_std_shot_spread 0.015
-set g_turrets_unit_walker_std_shot_force 	5
+set g_turrets_unit_walker_std_shot_spread 0.025
+set g_turrets_unit_walker_std_shot_force 	10
 set g_turrets_unit_walker_std_shot_radius 0
 set g_turrets_unit_walker_std_shot_speed 18000
 
 set g_turrets_unit_walker_std_shot_volly 10
-set g_turrets_unit_walker_std_shot_volly_refire 0.5
+set g_turrets_unit_walker_std_shot_volly_refire 1
 
 set g_turrets_unit_walker_std_target_range 5000
 set g_turrets_unit_walker_std_target_range_fire 2000
@@ -30,30 +30,29 @@
 set g_turrets_unit_walker_std_target_select_playerbias 1
 set g_turrets_unit_walker_std_target_select_missilebias 0
 
-set g_turrets_unit_walker_std_ammo_max 4000
-set g_turrets_unit_walker_std_ammo 500
+set g_turrets_unit_walker_std_ammo_max      4000
+set g_turrets_unit_walker_std_ammo          500
 set g_turrets_unit_walker_std_ammo_recharge 100
 
-set g_turrets_unit_walker_std_aim_firetolerance_dist 64
-set g_turrets_unit_walker_std_aim_firetolerance_angle 16
-set g_turrets_unit_walker_std_aim_speed 90
-set g_turrets_unit_walker_std_aim_maxrot 400	
-set g_turrets_unit_walker_std_aim_maxpitch 15
+set g_turrets_unit_walker_std_aim_firetolerance_dist  64
+set g_turrets_unit_walker_std_aim_speed               45
+set g_turrets_unit_walker_std_aim_maxrot              90	
+set g_turrets_unit_walker_std_aim_maxpitch            15
 
+// Head (minigun) is attached. must use tractype 1
 set g_turrets_unit_walker_std_track_type 1
 
 // "Wobbly" homing rockets that sometimes loop
 set g_turrets_unit_walker_std_rockets_range     4000
 set g_turrets_unit_walker_std_rockets_range_min 500
-set g_turrets_unit_walker_std_rocket_refire 10
-set g_turrets_unit_walker_std_rocket_dmg 50
-set g_turrets_unit_walker_std_rocket_radius 150
-set g_turrets_unit_walker_std_rocket_force 150
-set g_turrets_unit_walker_std_rocket_tunrate 0.6
-set g_turrets_unit_walker_std_rocket_speed 900
-set g_turrets_unit_walker_std_rocket_speed_add 2
+set g_turrets_unit_walker_std_rocket_refire     10
+set g_turrets_unit_walker_std_rocket_dmg        50
+set g_turrets_unit_walker_std_rocket_radius     150
+set g_turrets_unit_walker_std_rocket_force      150
+set g_turrets_unit_walker_std_rocket_tunrate    0.4
+set g_turrets_unit_walker_std_rocket_speed      900
 
 // Meele attack. Only happens when theres a target directly in front 
 set g_turrets_unit_walker_std_meele_range 150
-set g_turrets_unit_walker_std_meele_dmg 200
+set g_turrets_unit_walker_std_meele_dmg   100
 set g_turrets_unit_walker_std_meele_force 600
\ No newline at end of file

Copied: branches/nexuiz-2.0/misc/netradiant-NexuizPack (from rev 6332, trunk/misc/netradiant-NexuizPack)

Modified: branches/nexuiz-2.0/misc/tools/nexuiz-map-compiler
===================================================================
--- branches/nexuiz-2.0/misc/tools/nexuiz-map-compiler	2009-03-27 15:52:48 UTC (rev 6332)
+++ branches/nexuiz-2.0/misc/tools/nexuiz-map-compiler	2009-03-27 18:16:42 UTC (rev 6333)
@@ -82,6 +82,14 @@
 	{
 		$options->{light} = undef;
 	}
+	elsif($_ =~ /^-(-.*)/)
+	{
+		if($curmode eq 'maps')
+		{
+			$curmode = 'bsp';
+		}
+		push @{$options->{$curmode}}, $1;
+	}
 	elsif($_ =~ /^-/ and $curmode eq 'maps')
 	{
 		$curmode = 'bsp';



More information about the nexuiz-commits mailing list