diff --git a/code/game/objects/items/stacks/sheets/sheets.dm b/code/game/objects/items/stacks/sheets/sheets.dm index d0c78eb4102..1fe0bc57136 100644 --- a/code/game/objects/items/stacks/sheets/sheets.dm +++ b/code/game/objects/items/stacks/sheets/sheets.dm @@ -73,14 +73,22 @@ var/list/shards = list() for(var/datum/material/mat in custom_materials) if(mat.shard_type) - var/obj/item/new_shard = new mat.shard_type(user.loc) - new_shard.add_fingerprint(user) - shards += "\a [new_shard.name]" + shards += mat.shard_type if(!shards.len) return FALSE + if(!use(1)) + to_chat(user, is_cyborg ? span_warning("There is not enough material in the synthesizer to produce a shard!") : span_warning("Somehow, there is not enough of [src] to shatter!")) + if(!is_cyborg) + stack_trace("A stack of sheet material was attempted to be shattered into shards while having less than 1 sheets remaining.") + return FALSE user.do_attack_animation(src, ATTACK_EFFECT_BOOP) playsound(src, SFX_SHATTER, 70, TRUE) - use(1) - user.visible_message(span_notice("[user] shatters the sheet of [name] on the floor, leaving [english_list(shards)]."), \ - span_notice("You shatter the sheet of [name] on the floor, leaving [english_list(shards)].")) + var/list/shards_created = list() + for(var/shard_to_create in shards) + var/obj/item/new_shard = new shard_to_create(drop_location()) + new_shard.add_fingerprint(user) + shards_created += "[new_shard.name]" + user.visible_message(span_notice("[user] shatters the sheet of [name] on the floor, leaving [english_list(shards_created)]."), \ + span_notice("You shatter the sheet of [name] on the floor, leaving [english_list(shards_created)].")) return TRUE +