cmss13-devs / cmss13

Contains the code for CM-SS13
https://cm-ss13.com
GNU Affero General Public License v3.0
101 stars 564 forks source link

Being able to hold Airburst Grenades and tossing them into foes #3278

Open JohnBotBot opened 1 year ago

JohnBotBot commented 1 year ago

Testmerges

3088 #3273 #3271

Description of the bug

while i was playing as a grenadier specialist, i've accidentally fired at a cabinets in the Shiva's Snowball map at a short range with the M92 Grenade launcher in the direct hit mode, the fired projectile(Airburst grenade(non-incendiary)) was stopped directly at the CHEST DRAWER, the grenade stood on the floor, primed but did not burst into pellets, after trying to interact with it, i've been able to grab it with my hands and toss it, after tossing it, the grenade worked just fine, so you can simply grab the airburst grenades and toss them at the xenos with your bare hands(fun). seen first time at the round:16762

What's the difference with what should have happened?

the grenade should have exploded into shrapnel hitting the cabinet(*CHEST DRAWER)

How do we reproduce this bug?

1.M92 grenade launcher with airburst grenades 2.fire at a small cabinet(confirmed at the Sorokyne Strata map)(*CHEST DRAWER) 3.grab the primed grenade on the floor 4.toss the grenade 5.watch as it explodes into a cone of shrapnel into your enemies 6.profit 7.??? (ps:sorokyne strata rounds are painfully slow and very, VERY long and i am going to play TGMC instead of this frozen hellhole)

Issue Bingo

QuickLode commented 1 year ago

image Fuse Arming Wire, Set Back

That sounds immersive as fuck.

JohnBotBot commented 1 year ago

just a heads up that after trying with a M79 grenade launcher on a filing cabinet, i've come to a conclusion that filing cabinets and M79 grenade launchers make the airburst grenade fire backwards, beware of Friendly Fire(not sure yet if it is because of the grenade launcher type or the filing cabinet, as i wasn't able to test it further on other objects with the M92(*ONLY WORKS ON THE CHEST DRAWER)

JohnBotBot commented 1 year ago

im a ape and my brain had registered cabinet instead of chest drawer, already edited on the bug report

DoomLaser9 commented 1 year ago

I did some testing, and it seems that if the airburst grenades hit a wall and can't bounce back, then they don't explode (but still stay prime/flashing, and explode if you throw).

Example 1:

  1. Be right in between two walls (either one north and one south, or one east and one west). These walls must be adjacent to you.
  2. Fire airburst grenade (tested with M79 launcher) past one of the walls so it'll bounce back.
  3. Since it can't "bounce past" the wall behind you, it stays primed on the ground.

Example 2:

  1. Build a metal barricade two tiles from a wall. Make sure the barricade faces the wall, and that one empty space is between the cade and the wall.
  2. Fire grenade "past" wall so it'll hit the wall and try to bounce back.
  3. The nade can't bounce back over the cade, and stays primed on the floor without blowing up.

I suspect there may be a problem with /obj/item/explosive/grenade/high_explosive/airburst/launch_impact(atom/hit_atom) (and perhaps other similar functions too).

Abridged version of function:

..()
var/detonate = TRUE
if(isobj(hit_atom) && !rebounding)
    detonate = FALSE
if(isturf(hit_atom) && hit_atom.density && !rebounding)
    detonate = FALSE
if(active && detonate) // Active, and we reached our destination.
    // ...

If rebounding is always false, then perhaps the bottom conditional (the one where grenade explodes) is never activated, which is consistent with my observation that preventing an airburst grenade from "rebounding" off a wall causes the bug,