Fixes for black market creation verb. (#95619)

## About The Pull Request

The "Create Black Market Item" verb now needs an input so that it
doesn't try and crash the client.

The verb also has a few extra bits of cleanup. Successful completion of
the verb will now alert admins that it's been added to the market.

~~This also adds an additonal admin verb, "View Blackmarket", which will
allows you to view a blackmarket UI with all the currently loaded items.
(I HAVE YET TO MAKE THIS WORK WITH MY CURRENT STRATEGY, HENCE THIS PR
BEING A DRAFT).~~ Removed due to taking too long.

## Why It's Good For The Game

Better admin ui/ux, fewer ways to accidently crash your game from
viewing all `/obj`s in the game, and allows for more admin interaction
with the black market which the original PR intended to do.

## Changelog
🆑
fix: More safeguards were added to the admin "Create Black Market Item"
verb.
/🆑
This commit is contained in:
ArcaneMusic
2026-04-22 13:09:54 +02:00
committed by GitHub
parent 32c1e73dc1
commit 57be83952e
+6 -1
View File
@@ -804,10 +804,14 @@ ADMIN_VERB(give_ai_speech, R_FUN, "Give Random AI Speech", ADMIN_VERB_NO_DESCRIP
our_controller.planning_subtrees = list(GLOB.ai_subtrees[/datum/ai_planning_subtree/random_speech/blackboard]) + our_controller.planning_subtrees
ADMIN_VERB(new_blackmarket_item, R_BUILD, "Create Black Market Item", "Add an item to the black market for purchase.", ADMIN_CATEGORY_EVENTS, object as text)
if(!object)
to_chat(user, span_boldwarning("Failed! Provide a full or partial typepath!"))
return
//first: have admins select a typepath for the item they want to offer.
var/obj/chosen = pick_closest_path(object, make_types_fancy(subtypesof(/obj)))
// second: poll admins for the name, description, price, and quantity.
if(isnull(chosen))
return
var/name = tgui_input_text(user, "Name of the item to sell?", "Item listing name", "Arcane Object", max_length = MAX_NAME_LEN)
if(isnull(name))
return
@@ -842,5 +846,6 @@ ADMIN_VERB(new_blackmarket_item, R_BUILD, "Create Black Market Item", "Add an it
SSmarket.initialize_admin_item(admin_item)
log_admin("[key_name(user)] created a new black market item: [name] ([chosen]) for [price] credits, of quantity [quantity].")
message_admins("[key_name(user)] created a new black market item: [name] ([chosen]) for [price] credits, of quantity [quantity].")
BLACKBOX_LOG_ADMIN_VERB("Create Black Market Item")