mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-16 20:16:09 +00:00
## About The Pull Request Fixes Issue https://github.com/tgstation/tgstation/issues/56152 making wood tables deconstruct at they should be. Bug vivisection: Okay, see here? This is the proc for creating a table, we can introduce three arguments. One of them is _buildstack. _buildstack overrides Buildstack on initialize, a variable used for storing the type of raw "ore" that the table is supposed to drop in deconstruction. Here is supposed to be null unless we want to override the buildstack with another ore. ```DM /obj/structure/table_frame/proc/make_new_table(table_type, custom_materials, _buildstack) var/obj/structure/table/T = new table_type(loc, _buildstack) T.frame = type T.framestack = framestack T.framestackamount = framestackamount if(custom_materials) T.set_custom_materials(custom_materials) qdel(src) ``` What happened? The proc for building a wood table from a wooden frame, shown below, passed the "type" variable, used for storing the type of table_frame, as a _buildstack argument to the make_new_table proc. This overrides the buildstack variable of the final wooden table, causing it to drop a wooden frame as it was an ore on deconstruction. ```DM /obj/structure/table_frame/wood/attackby(obj/item/I, mob/user, params) [...] if (toConstruct) if(material.get_amount() < 1) to_chat(user, "<span class='warning'>You need one [material.name] sheet to do this!</span>") return to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>") if(do_after(user, 20, target = src) && material.use(1)) make_new_table(toConstruct, null, type) ``` This is funnier (not very much, to be honest) when we consider that deconstructing with a screwdriver would drop a frame normally, causing it to drop two frames. We could repeat this ad nauseam, essentially cloning wood frames in place as we pleased. So TL;DR: this is another of those simple but hard to hunt bugs that would be prevented with testing and a null on its right place.
3.9 KiB
3.9 KiB