Fixed multi-stacking light replacing doafter (#20087)

Removed a snowflake storage code for the light replacer, that was
bypassing the doafter loading inside afterattack.
Fixed multi-stacking light replacing doafter.

Fixes #19508
This commit is contained in:
Fluffy
2024-10-20 11:28:25 +00:00
committed by GitHub
parent 354fb8442b
commit 4649648d6a
3 changed files with 61 additions and 17 deletions
@@ -147,7 +147,7 @@
to_chat(user, SPAN_WARNING("There are no more working lights left in the box!"))
return
if (do_after(user, load_interval, do_flags = DO_DEFAULT & ~DO_USER_SAME_HAND) && boxstartloc == box.loc && ourstartloc == src.loc)
if (do_after(user, load_interval, box, do_flags = DO_UNIQUE & ~DO_USER_SAME_HAND) && boxstartloc == box.loc && ourstartloc == src.loc)
if(uses >= max_uses) //catches loading from multiple boxes
break
uses++
@@ -714,22 +714,7 @@
..()
if(!attacking_item.dropsafety())
return.
if(istype(attacking_item, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LP = attacking_item
var/amt_inserted = 0
var/turf/T = get_turf(user)
for(var/obj/item/light/L in src.contents)
if(L.status == 0)
if(LP.uses < LP.max_uses)
LP.AddUses(1)
amt_inserted++
remove_from_storage(L, T)
qdel(L)
if(amt_inserted)
to_chat(user, "You inserted [amt_inserted] light\s into \the [LP.name]. You have [LP.uses] light\s remaining.")
return
return
if(!can_be_inserted(attacking_item))
return