mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Fixes reflectors and a Projectile angle bug
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
/obj/structure/reflector/bullet_act(obj/item/projectile/P)
|
||||
var/turf/reflector_turf = get_turf(src)
|
||||
var/turf/reflect_turf
|
||||
var/new_dir = get_reflection(dir, P.dir)
|
||||
if(!istype(P, /obj/item/projectile/beam))
|
||||
return ..()
|
||||
var/new_dir = get_reflection(dir, P.dir)
|
||||
if(new_dir)
|
||||
reflect_turf = get_step(reflect_turf, new_dir)
|
||||
else
|
||||
@@ -30,6 +30,10 @@
|
||||
P.current = reflector_turf
|
||||
P.yo = reflect_turf.y - reflector_turf.y
|
||||
P.xo = reflect_turf.x - reflector_turf.x
|
||||
P.ignore_source_check = TRUE //If shot by a laser, will now hit the mob that fired it
|
||||
var/reflect_angle = dir2angle(new_dir)
|
||||
P.setAngle(reflect_angle)
|
||||
|
||||
new_dir = 0
|
||||
return -1
|
||||
|
||||
|
||||
@@ -254,6 +254,7 @@
|
||||
shot_number = 0
|
||||
P.setDir(dir)
|
||||
P.starting = loc
|
||||
P.Angle = null
|
||||
P.fire()
|
||||
return P
|
||||
|
||||
|
||||
@@ -240,8 +240,7 @@
|
||||
if(!paused)
|
||||
if((!( current ) || loc == current))
|
||||
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
|
||||
|
||||
if(!Angle)
|
||||
if(isnull(Angle))
|
||||
Angle=round(Get_Angle(src,current))
|
||||
if(spread)
|
||||
Angle += (rand() - 0.5) * spread
|
||||
|
||||
Reference in New Issue
Block a user