diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 3c3d345dd6b..8eb99205789 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -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