mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
[MIRROR] Fixing an oversight with processable items that leads to the same chat message being sent multiple times [MDB IGNORE] (#22985)
* Fixing an oversight with processable items that leads to the same chat message being sent multiple times (#77443) ## About The Pull Request Exactly what it reads on the title. Also, I've stored the value of atoms to create in a variable. ## Why It's Good For The Game This will fix #77378. ## Changelog 🆑 fix: Fixed an oversight with processable items that lead to the same chat message being sent multiple times. /🆑 * Fixing an oversight with processable items that leads to the same chat message being sent multiple times --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
+4
-3
@@ -1668,18 +1668,19 @@
|
||||
if(process_item.use_tool(src, user, processing_time, volume=50))
|
||||
var/atom/atom_to_create = chosen_option[TOOL_PROCESSING_RESULT]
|
||||
var/list/atom/created_atoms = list()
|
||||
for(var/i = 1 to chosen_option[TOOL_PROCESSING_AMOUNT])
|
||||
var/amount_to_create = chosen_option[TOOL_PROCESSING_AMOUNT]
|
||||
for(var/i = 1 to amount_to_create)
|
||||
var/atom/created_atom = new atom_to_create(drop_location())
|
||||
if(custom_materials)
|
||||
created_atom.set_custom_materials(custom_materials, 1 / chosen_option[TOOL_PROCESSING_AMOUNT])
|
||||
created_atom.set_custom_materials(custom_materials, 1 / amount_to_create)
|
||||
created_atom.pixel_x = pixel_x
|
||||
created_atom.pixel_y = pixel_y
|
||||
if(i > 1)
|
||||
created_atom.pixel_x += rand(-8,8)
|
||||
created_atom.pixel_y += rand(-8,8)
|
||||
created_atom.OnCreatedFromProcessing(user, process_item, chosen_option, src)
|
||||
to_chat(user, span_notice("You manage to create [chosen_option[TOOL_PROCESSING_AMOUNT]] [initial(atom_to_create.gender) == PLURAL ? "[initial(atom_to_create.name)]" : "[initial(atom_to_create.name)][plural_s(initial(atom_to_create.name))]"] from [src]."))
|
||||
created_atoms.Add(created_atom)
|
||||
to_chat(user, span_notice("You manage to create [amount_to_create] [initial(atom_to_create.gender) == PLURAL ? "[initial(atom_to_create.name)]" : "[initial(atom_to_create.name)][plural_s(initial(atom_to_create.name))]"] from [src]."))
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_PROCESSED, user, process_item, created_atoms)
|
||||
UsedforProcessing(user, process_item, chosen_option)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user