mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
Fix for material tiles and walls not having material when constructed from last item in the stack (#96404)
## About The Pull Request Fixes #96244. Problem was that when you use last item in the stack, the stack gets qdel'd and the destructor is called. The destructor sets `mats_per_unit = null` for the object, and when custom materials applied to tile/wall it is null. Bug was caused by #92620. I'm not gonna review 272 files from that PR to see if I can delete that destructor, potentially breaking something else, so this is a lazy fix for the annoying bug which is 6 months old. ## Changelog 🆑 fix: fixed material tiles and walls not having material when constructed from last item in the stack /🆑
This commit is contained in:
@@ -1162,9 +1162,11 @@
|
||||
merge_type = /obj/item/stack/tile/material
|
||||
|
||||
/obj/item/stack/tile/material/place_tile(turf/open/target_plating, mob/user)
|
||||
// Save refernce to the materials for the case when we place last tile in the stack
|
||||
var/list/saved_mats_per_unit = mats_per_unit
|
||||
. = ..()
|
||||
var/turf/open/floor/material/floor = .
|
||||
floor?.set_custom_materials(mats_per_unit)
|
||||
floor?.set_custom_materials(saved_mats_per_unit)
|
||||
|
||||
/obj/item/stack/tile/eighties
|
||||
name = "retro tile"
|
||||
|
||||
Reference in New Issue
Block a user