Skip to content

Commit

Permalink
frag grenade shell wall bug resolution (discordia-space#8400)
Browse files Browse the repository at this point in the history
grenade shells now universally qdel self on activation
  • Loading branch information
vode-code authored Feb 2, 2024
1 parent 1841c0f commit 99f33dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,13 @@
else
passthrough = (A.bullet_act(src, def_zone) == PROJECTILE_CONTINUE) //backwards compatibility
if(isturf(A))
for(var/obj/O in A)
if(QDELETED(src)) // we don't want bombs to explode once for every time bullet_act is called
on_impact(A)
invisibility = 101
return TRUE // see that next line? it can overload the server.
for(var/obj/O in A) // if src's bullet act spawns more objs, the list will increase,
if(O.density)
O.bullet_act(src)
O.bullet_act(src) // causing exponential growth due to the spawned obj spawning itself
for(var/mob/living/M in A)
attack_mob(M)

Expand Down
10 changes: 8 additions & 2 deletions code/modules/projectiles/projectile/projectilegrenades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
grenade_effect(target)

/obj/item/projectile/bullet/grenade/proc/grenade_effect(target)
return
qdel(src) // DO NOT ALLOW SRC TO SURVIVE THIS
SHOULD_CALL_PARENT(TRUE)

/obj/item/projectile/bullet/grenade/blast
name = "blast shell"
Expand All @@ -30,6 +31,7 @@

/obj/item/projectile/bullet/grenade/blast/grenade_effect(target)
explosion(get_turf(target), explosion_power, explosion_falloff)
. = ..()

/obj/item/projectile/bullet/grenade/heatwave
name = "heatwave shell"
Expand All @@ -40,7 +42,8 @@
var/fire_stacks = TRUE

/obj/item/projectile/bullet/grenade/heatwave/grenade_effect(target)
heatwave(target, heavy_range, weak_range, heat_damage, fire_stacks, penetration)
heatwave(target, heavy_range, weak_range, heat_damage, fire_stacks, penetration)
. = ..()

/obj/item/projectile/bullet/grenade/frag
name = "frag shell"
Expand All @@ -66,6 +69,7 @@
/obj/item/projectile/bullet/grenade/frag/grenade_effect(target)
fragment_explosion(target, range, f_type, f_amount, f_damage, f_step, same_turf_hit_chance)
explosion(get_turf(target), 60, 40)
. = ..()

/obj/item/projectile/bullet/grenade/frag/sting/weak
name = "sting shell"
Expand All @@ -80,6 +84,7 @@

/obj/item/projectile/bullet/grenade/emp/grenade_effect(target)
empulse(target, heavy_emp_range, light_emp_range)
. = ..()

/obj/item/projectile/bullet/grenade/emp/low_yield
heavy_emp_range = 4
Expand All @@ -94,6 +99,7 @@
/obj/item/projectile/bullet/grenade/handgrenade/grenade_effect(target)
var/obj/item/grenade/G = new hand_gren(src)
G.prime()
. = ..()

/obj/item/projectile/bullet/grenade/handgrenade/teargas // Because why not
name = "cs shell"
Expand Down

0 comments on commit 99f33dd

Please sign in to comment.