Fixes reflectors and a Projectile angle bug

This commit is contained in:
FreeStylaLT
2019-12-15 12:04:29 +02:00
parent 1029bf7e7a
commit d911954920
3 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -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
+1 -2
View File
@@ -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