mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Merge pull request #12218 from phil235/BugFixBoogalooA
Fixes critical bug causing multiple hits from single projectile.
This commit is contained in:
@@ -140,27 +140,28 @@ Gunshots/explosions/opening doors/less rare audio (done)
|
||||
radius++
|
||||
if(radius > FAKE_FLOOD_MAX_RADIUS)
|
||||
qdel(src)
|
||||
return
|
||||
Expand()
|
||||
next_expand = world.time + FAKE_FLOOD_EXPAND_TIME
|
||||
return
|
||||
|
||||
/obj/effect/hallucination/fake_flood/proc/Expand()
|
||||
if(!flood_turfs) //for qdel
|
||||
return
|
||||
for(var/turf/T in circlerangeturfs(loc,radius))
|
||||
if((T in flood_turfs)|| T.blocks_air)
|
||||
continue
|
||||
flood_images += image(image_icon,T,image_state,MOB_LAYER)
|
||||
flood_turfs += T
|
||||
if(target.client) target.client.images |= flood_images
|
||||
return
|
||||
if(target.client)
|
||||
target.client.images |= flood_images
|
||||
|
||||
/obj/effect/hallucination/fake_flood/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
qdel(flood_turfs)
|
||||
if(target.client) target.client.images.Remove(flood_images)
|
||||
flood_turfs = list()
|
||||
if(target.client)
|
||||
target.client.images.Remove(flood_images)
|
||||
target = null
|
||||
qdel(flood_images)
|
||||
flood_images = list()
|
||||
return ..()
|
||||
|
||||
/obj/effect/hallucination/simple/xeno
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
ready_proj(target, user, quiet, zone_override)
|
||||
if(distro)
|
||||
targloc = spread(targloc, curloc, distro)
|
||||
if(!throw_proj(targloc, user, params))
|
||||
if(!throw_proj(target, targloc, user, params))
|
||||
return 0
|
||||
if(i > 1)
|
||||
newshot()
|
||||
@@ -15,7 +15,7 @@
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/item/ammo_casing/proc/ready_proj(atom/target as mob|obj|turf, mob/living/user, quiet, zone_override = "")
|
||||
/obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
|
||||
if (!BB)
|
||||
return
|
||||
BB.original = target
|
||||
@@ -30,14 +30,15 @@
|
||||
reagents.trans_to(BB, reagents.total_volume) //For chemical darts/bullets
|
||||
qdel(reagents)
|
||||
|
||||
/obj/item/ammo_casing/proc/throw_proj(var/turf/targloc, mob/living/user as mob|obj, params)
|
||||
/obj/item/ammo_casing/proc/throw_proj(atom/target, turf/targloc, mob/living/user, params)
|
||||
var/turf/curloc = user.loc
|
||||
if (!istype(targloc) || !istype(curloc) || !BB)
|
||||
return 0
|
||||
if(targloc == curloc)
|
||||
if(BB.original == user) //if we target ourselves we go straight to bullet_act()
|
||||
user.bullet_act(BB, BB.def_zone)
|
||||
if(target) //if the target is right on our location we go straight to bullet_act()
|
||||
target.bullet_act(BB, BB.def_zone)
|
||||
qdel(BB)
|
||||
BB = null
|
||||
return 1
|
||||
BB.loc = get_turf(user)
|
||||
BB.starting = get_turf(user)
|
||||
@@ -51,7 +52,6 @@
|
||||
BB.p_x = text2num(mouse_control["icon-x"])
|
||||
if(mouse_control["icon-y"])
|
||||
BB.p_y = text2num(mouse_control["icon-y"])
|
||||
|
||||
if(BB)
|
||||
BB.fire()
|
||||
BB = null
|
||||
|
||||
@@ -122,14 +122,14 @@
|
||||
|
||||
/obj/item/weapon/gun/afterattack(atom/target as mob|obj|turf, mob/living/carbon/human/user as mob|obj, flag, params)//TODO: go over this
|
||||
if(flag) //It's adjacent, is the user, or is on the user's person
|
||||
if(istype(target, /mob/) && !(target in user.contents) && target != user && user.a_intent == "harm")
|
||||
//We make sure that it is a mob, it's not us or part of us.
|
||||
return //Flogging action
|
||||
else if(ishuman(target) && ishuman(user))
|
||||
if(user.zone_sel.selecting == "mouth")
|
||||
handle_suicide(user, target, params)
|
||||
return
|
||||
else
|
||||
if(target in user.contents) //can't shoot stuff inside us.
|
||||
return
|
||||
if(!ismob(target) || user.a_intent == "harm") //melee attack
|
||||
return
|
||||
if(user.zone_sel.selecting == "mouth")
|
||||
handle_suicide(user, target, params)
|
||||
return
|
||||
if(target == user) //so we can't shoot ourselves (unless mouth selected)
|
||||
return
|
||||
|
||||
//Exclude lasertag guns from the CLUMSY check.
|
||||
@@ -391,10 +391,11 @@
|
||||
semicd = 1
|
||||
|
||||
if(!do_mob(user, target, 120) || user.zone_sel.selecting != "mouth")
|
||||
if(user == target && user)
|
||||
user.visible_message("<span class='notice'>[user] decided life was worth living.</span>")
|
||||
else if(user && target && target.Adjacent(user))
|
||||
target.visible_message("<span class='notice'>[user] has decided to spare [target]'s life.</span>", "<span class='notice'>[user] has decided to spare your life!</span>")
|
||||
if(user)
|
||||
if(user == target)
|
||||
user.visible_message("<span class='notice'>[user] decided life was worth living.</span>")
|
||||
else if(target && target.Adjacent(user))
|
||||
target.visible_message("<span class='notice'>[user] has decided to spare [target]'s life.</span>", "<span class='notice'>[user] has decided to spare your life!</span>")
|
||||
semicd = 0
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user