Fixes floorbots potentially ending up with negative tiles in their inventory. (#52772)

This commit is contained in:
ShizCalev
2020-08-10 17:03:43 -03:00
committed by GitHub
parent ac527bdc41
commit a611971abe
@@ -349,11 +349,11 @@
mode = BOT_REPAIRING
visible_message("<span class='notice'>[src] begins replacing the floor tiles.</span>")
sleep(50)
if(mode == BOT_REPAIRING && F && src.loc == F)
if(mode == BOT_REPAIRING && F && loc == F && replacetiles && specialtiles) //make sure our mode and tiles are the same after sleeping.
F.broken = FALSE
F.burnt = FALSE
F.PlaceOnTop(initial(tiletype.turf_type), flags = CHANGETURF_INHERIT_AIR)
specialtiles -= 1
specialtiles--
if(specialtiles == 0)
speak("Requesting refill of custom floor tiles to continue replacing.")
mode = BOT_IDLE