about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-22 03:33:50 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-22 03:33:50 +0000
commitdac2ac3470ffc24185472bf82efd762cff9ae6f7 (patch)
tree3845b25f5caeb54eb4eca0fb3a8bd4ca961cf8f8 /src/game/server
parent3d434173e69dc62c84f8f85ddd5efa40426b3fcf (diff)
downloadzcatch-dac2ac3470ffc24185472bf82efd762cff9ae6f7.tar.gz
zcatch-dac2ac3470ffc24185472bf82efd762cff9ae6f7.zip
moved projectile spawning out a bit from the character to prevent it from hitting stuff behind the player
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gs_server.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index 2940400f..6218ef5c 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -998,6 +998,8 @@ void player::fire_weapon()
 		return;
 	}
 	
+	vec2 projectile_startpos = pos+direction*phys_size*0.75f;
+	
 	switch(active_weapon)
 	{
 		case WEAPON_HAMMER:
@@ -1037,7 +1039,7 @@ void player::fire_weapon()
 		{
 			projectile *proj = new projectile(WEAPON_GUN,
 				client_id,
-				pos+vec2(0,0),
+				projectile_startpos,
 				direction,
 				(int)(server_tickspeed()*tuning.gun_lifetime),
 				this,
@@ -1073,7 +1075,7 @@ void player::fire_weapon()
 				float speed = mix((float)tuning.shotgun_speeddiff, 1.0f, v);
 				projectile *proj = new projectile(WEAPON_SHOTGUN,
 					client_id,
-					pos,
+					projectile_startpos,
 					vec2(cosf(a), sinf(a))*speed,
 					(int)(server_tickspeed()*tuning.shotgun_lifetime),
 					this,
@@ -1097,7 +1099,7 @@ void player::fire_weapon()
 		{
 			projectile *proj = new projectile(WEAPON_GRENADE,
 				client_id,
-				pos+vec2(0,0),
+				projectile_startpos,
 				direction,
 				(int)(server_tickspeed()*tuning.grenade_lifetime),
 				this,