tgstation / tgstation

The /tg/station branch of SS13.
https://www.tgstation13.org/
GNU Affero General Public License v3.0
1.73k stars 4.78k forks source link

Sulfuric acid, fluorosulfuric acid, and nitric acid do not deal damage properly when injected #69243

Closed wulfenbach-jpg closed 2 years ago

wulfenbach-jpg commented 2 years ago

Round ID: N/A

Testmerges: N/A

Reproduction:

  1. Fill a syringe with 5u Sulfuric Acid, 5u Fluorosulfuric Acid, and 5u Nitric Acid
  2. Inject human with syringe.
  3. Expected result is for brute and burn damage to be dealt, as intended in toxin_reagents.dm
  4. All 3 acids in the syringe only do 5 burn damage and 48 toxin damage, with 0 brute damage being dealt. Moreover, a syringe filled with 15u sulfuric acid does 0 brute damage. However, the brute/burn damage is dealt when the acids are splashed onto the target.
antropod commented 2 years ago

I blame #69035

ran this code with debugger and for some reason r_to_expose has volume of 0 for each reagent. (Blame references?)

/datum/reagents/proc/expose_multiple(list/r_to_expose, atom/A, methods = TOUCH, volume_modifier = 1, show_message = 1)
    if(isnull(A))
        return null

    var/list/cached_reagents = r_to_expose
    if(!cached_reagents.len)
        return null

    var/list/reagents = list()
    for(var/datum/reagent/reagent as anything in cached_reagents)
        reagents[reagent] = reagent.volume * volume_modifier

    return A.expose_reagents(reagents, src, methods, volume_modifier, show_message)
TemporalOroboros commented 2 years ago

I wouldn't be surprised if the code is referring to the reagents from the original container. In that case the volume would be getting set to zero because they are used up in the transfer.

It would also be pretty easy to check because in that case they should be in the process of deleting.

antropod commented 2 years ago

This is not only about acid, anything that uses reac_volume in expose_mob is likely broken too, Here is a list of potentially affected reagents: all blob reagents, clf3, phlogiston, napalm, welding fuel, bluespace dust, nitrous oxide, acetone oxide, ants, cooking oil, ...