This commit is contained in:
silicons
2021-06-12 04:49:23 -07:00
parent 55e8d67521
commit 8feb473e65
4 changed files with 9 additions and 7 deletions

View File

@@ -37,7 +37,7 @@
to_chat(M, "<span class='notice'>You start dumping out tier/cell rating [lowest_rating] parts from [parent].</span>")
var/turf/T = get_turf(A)
var/datum/progressbar/progress = new(M, length(things), T)
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress)))
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
stoplag(1)
qdel(progress)
A.do_squish(0.8, 1.2)
@@ -81,7 +81,7 @@
to_chat(M, "<span class='notice'>You start dumping out tier/cell rating [lowest_rating] parts from [parent].</span>")
var/turf/T = get_turf(A)
var/datum/progressbar/progress = new(M, length(things), T)
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress)))
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
stoplag(1)
qdel(progress)
A.do_squish(0.8, 1.2)

View File

@@ -271,20 +271,20 @@
var/turf/T = get_turf(A)
var/list/things = contents()
var/datum/progressbar/progress = new(M, length(things), T)
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress)))
while (do_after(M, 10, TRUE, T, FALSE, CALLBACK(src, .proc/mass_remove_from_storage, T, things, progress, TRUE, M)))
stoplag(1)
qdel(progress)
A.do_squish(0.8, 1.2)
/datum/component/storage/proc/mass_remove_from_storage(atom/target, list/things, datum/progressbar/progress, trigger_on_found = TRUE)
/datum/component/storage/proc/mass_remove_from_storage(atom/target, list/things, datum/progressbar/progress, trigger_on_found = TRUE, mob/user)
var/atom/real_location = real_location()
for(var/obj/item/I in things)
things -= I
if(I.loc != real_location)
continue
remove_from_storage(I, target)
if(trigger_on_found && I.on_found())
if(trigger_on_found && user && (user.active_storage != src) && I.on_found(user))
return FALSE
remove_from_storage(I, target)
if(TICK_CHECK)
progress.update(progress.goal - length(things))
return TRUE

View File

@@ -800,6 +800,8 @@
var/list/things = src_object.contents()
var/datum/progressbar/progress = new(user, things.len, src)
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
if(STR == src_object)
return
while (do_after(user, 10, TRUE, src, FALSE, CALLBACK(STR, /datum/component/storage.proc/handle_mass_item_insertion, things, src_object, user, progress)))
stoplag(1)
qdel(progress)

View File

@@ -386,7 +386,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
var/list/things = src_object.contents()
var/datum/progressbar/progress = new(user, things.len, src)
while (do_after(usr, 1 SECONDS, TRUE, src, FALSE, CALLBACK(src_object, /datum/component/storage.proc/mass_remove_from_storage, src, things, progress)))
while (do_after(usr, 1 SECONDS, TRUE, src, FALSE, CALLBACK(src_object, /datum/component/storage.proc/mass_remove_from_storage, src, things, progress, TRUE, user)))
stoplag(1)
qdel(progress)