[MIRROR] Fixing bugs about the worst simple_animal coded in and material tiles. (#2654)

* 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.

* Fixing bugs about the worst simple_animal coded in and material tiles.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-01-12 06:54:10 +01:00
committed by GitHub
co-authored by Ghom
parent 3a05ebac83
commit c80aec0b74
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)