about summary refs log tree commit diff
path: root/src/game/server/entities
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2009-01-11 10:26:17 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2009-01-11 10:26:17 +0000
commit371e8623161095b8f74d51d37f3de368b5cd584c (patch)
treef3d2987e542d7d01529b871337a3efe7b4b9ab01 /src/game/server/entities
parent518db9218fcb3152d02bbc7b9bb3b0e5ff52a41b (diff)
downloadzcatch-371e8623161095b8f74d51d37f3de368b5cd584c.tar.gz
zcatch-371e8623161095b8f74d51d37f3de368b5cd584c.zip
fixed so the laser bounces correctly at low angles
Diffstat (limited to 'src/game/server/entities')
-rw-r--r--src/game/server/entities/laser.cpp6
-rw-r--r--src/game/server/entities/projectile.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/game/server/entities/laser.cpp b/src/game/server/entities/laser.cpp
index 20054ed4..2c6fa0ff 100644
--- a/src/game/server/entities/laser.cpp
+++ b/src/game/server/entities/laser.cpp
@@ -48,14 +48,16 @@ void LASER::do_bounce()
 	}
 	
 	vec2 to = pos + dir*energy;
+	vec2 org_to = to;
 	
-	if(col_intersect_line(pos, to, &to))
+	if(col_intersect_line(pos, to, 0x0, &to))
 	{
 		if(!hit_character(pos, to))
 		{
 			// intersected
 			from = pos;
-			pos = to - dir*2;
+			pos = to;
+
 			vec2 temp_pos = pos;
 			vec2 temp_dir = dir*4.0f;
 			
diff --git a/src/game/server/entities/projectile.cpp b/src/game/server/entities/projectile.cpp
index e0b4701a..2a8de766 100644
--- a/src/game/server/entities/projectile.cpp
+++ b/src/game/server/entities/projectile.cpp
@@ -65,7 +65,7 @@ void PROJECTILE::tick()
 
 	lifespan--;
 	
-	int collide = col_intersect_line(prevpos, curpos, &curpos);
+	int collide = col_intersect_line(prevpos, curpos, &curpos, 0);
 	//int collide = col_check_point((int)curpos.x, (int)curpos.y);
 	CHARACTER *ownerchar = game.get_player_char(owner);
 	CHARACTER *targetchr = game.world.intersect_character(prevpos, curpos, 6.0f, curpos, ownerchar);