[s] Fix a Syndicate Bundle oversight (#23675)

* Fix syndicate bundle inputs staying valid for too long

* Cleanup + readability

* Grammar police weewoo
This commit is contained in:
Nathan Winters
2023-12-29 16:09:46 +00:00
committed by GitHub
parent 112358f1d8
commit 4ce63de343
@@ -81,19 +81,22 @@
/obj/item/radio/beacon/syndicate/bundle/attack_self(mob/user)
if(!user)
return
if(!length(selected))
unselected = bundles.Copy()
for(var/i in 1 to 3)
selected += pick_n_take(unselected)
selected += "Random"
var/bundle_name = tgui_input_list(user, "Available Bundles", "Bundle Selection", selected)
if(!bundle_name)
var/bundle_name = tgui_input_list(user, "Available Bundles", "Bundle Selection", selected)
if(!bundle_name || QDELETED(src))
return
if(bundle_name == "Random")
bundle_name = pick(unselected)
var/bundle = bundles[bundle_name]
bundle = new bundle(user.loc)
to_chat(user, "<span class='notice'>Welcome to [station_name()], [bundle_name]</span>")
to_chat(user, "<span class='notice'>Welcome to [station_name()], [bundle_name]!</span>")
user.drop_item()
qdel(src)
user.put_in_hands(bundle)