diff --git a/src/weapon.c b/src/weapon.c index 657fc85..6532477 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -722,7 +722,7 @@ static void weapon_hitBeam(Weapon* w, Pilot* p, WeaponLayer layer, */ static Weapon* weapon_create(const Outfit* outfit, const double dir, const Vec2* pos, const Vec2* vel, unsigned int parent, const unsigned int target) { - Vec2 v, vp; + Vec2 v; double mass, rdir; Pilot* pilot_target; double x, y, t, dist; @@ -780,15 +780,11 @@ static Weapon* weapon_create(const Outfit* outfit, const double dir, const Vec2* if((rdir > 2.*M_PI) || (rdir < 0.)) rdir = fmod(rdir, 2.*M_PI); - /* Set the position to include sprite size. */ - vect_cset(&vp, pos->x + cos(rdir)*w->outfit->u.blt.gfx_space->sx/2., - pos->y + sin(rdir)*w->outfit->u.blt.gfx_space->sy/2.); - mass = 1; /* Lasers are presumed to have unitory mass. */ vectcpy(&v, vel); vect_cadd(&v, outfit->u.blt.speed*cos(rdir), outfit->u.blt.speed*sin(rdir)); w->timer = outfit->u.blt.range/outfit->u.blt.speed; - w->solid = solid_create(mass, rdir, &vp, &v); + w->solid = solid_create(mass, rdir, pos, &v); w->voice = sound_playPos(w->outfit->u.blt.sound, w->solid->pos.x + w->solid->vel.x, w->solid->pos.y + w->solid->vel.y);