From 371e8623161095b8f74d51d37f3de368b5cd584c Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 11 Jan 2009 10:26:17 +0000 Subject: fixed so the laser bounces correctly at low angles --- src/game/server/entities/laser.cpp | 6 ++++-- src/game/server/entities/projectile.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game/server/entities') 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); -- cgit 1.4.1