Fixing bugs about the worst simple_animal coded in and material tiles. (#54885)

Fixed floorbots applying floor tiles onto already tiled turfs.
Fixed floorbot issues with material tiles.
Fixed emagged floorbots spawning lattice when deconstructing floor into plating.
This commit is contained in:
Ghom
2021-01-11 18:03:54 -08:00
committed by GitHub
parent 5ac864a993
commit bd582f2098
7 changed files with 115 additions and 85 deletions
+3 -2
View File
@@ -417,14 +417,15 @@
return FALSE
return TRUE
/obj/item/stack/proc/merge(obj/item/stack/S) //Merge src into S, as much as possible
///Merges src into S, as much as possible. If present, the limit arg overrides S.max_amount for transfer.
/obj/item/stack/proc/merge(obj/item/stack/S, limit)
if(QDELETED(S) || QDELETED(src) || S == src) //amusingly this can cause a stack to consume itself, let's not allow that.
return
var/transfer = get_amount()
if(S.is_cyborg)
transfer = min(transfer, round((S.source.max_energy - S.source.energy) / S.cost))
else
transfer = min(transfer, S.max_amount - S.amount)
transfer = min(transfer, (limit ? limit : S.max_amount) - S.amount)
if(pulledby)
pulledby.start_pulling(S)
S.copy_evidences(src)
@@ -19,3 +19,8 @@
qdel(src)
else
return ..()
/obj/item/stack/tile/light/place_tile(turf/open/T)
. = ..()
var/turf/open/floor/light/F = .
F?.state = state
@@ -94,6 +94,11 @@
else
return ..()
/obj/item/stack/tile/proc/place_tile(turf/open/T)
if(!turf_type || !use(1))
return
. = T.PlaceOnTop(turf_type, flags = CHANGETURF_INHERIT_AIR)
//Grass
/obj/item/stack/tile/grass
name = "grass tile"
@@ -421,6 +426,11 @@
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
merge_type = /obj/item/stack/tile/material
/obj/item/stack/tile/material/place_tile(turf/open/T)
. = ..()
var/turf/open/floor/material/F = .
F?.set_custom_materials(mats_per_unit)
/obj/item/stack/tile/eighties
name = "retro tile"
singular_name = "retro floor tile"