From cfa10bf239bc027eca4c03a990bf5e5efad7ce7d Mon Sep 17 00:00:00 2001 From: SandPoot <43283559+SandPoot@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:56:36 -0300 Subject: [PATCH] Fixes an immense amount of runtimes. (#247) --- .../code/datums/interactions/lewd/_lewd.dm | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/modular_sand/code/datums/interactions/lewd/_lewd.dm b/modular_sand/code/datums/interactions/lewd/_lewd.dm index bd5a2a3e90..8354bb0b7f 100644 --- a/modular_sand/code/datums/interactions/lewd/_lewd.dm +++ b/modular_sand/code/datums/interactions/lewd/_lewd.dm @@ -412,30 +412,33 @@ ///Are we wearing something that covers our chest? /mob/living/proc/is_topless() for(var/slot in GLOB.slots) - var/obj/item/clothing = vars[slot] - if(clothing) - if(clothing.body_parts_covered & CHEST) - return FALSE + if(slot in vars) + var/obj/item/clothing = vars[slot] + if(clothing) + if(clothing.body_parts_covered & CHEST) + return FALSE // If didn't stop before, then we're topless return TRUE ///Are we wearing something that covers our groin? /mob/living/proc/is_bottomless() for(var/slot in GLOB.slots) - var/obj/item/clothing = vars[slot] - if(clothing) - if(clothing.body_parts_covered & GROIN) - return FALSE + if(slot in vars) + var/obj/item/clothing = vars[slot] + if(clothing) + if(clothing.body_parts_covered & GROIN) + return FALSE // If didn't stop before, then we're bottomless return TRUE ///Are we wearing something that covers our shoes? /mob/living/proc/is_barefoot() for(var/slot in GLOB.slots) - var/obj/item/clothing = vars[slot] - if(clothing) - if(clothing.body_parts_covered & FEET) - return FALSE + if(slot in vars) + var/obj/item/clothing = vars[slot] + if(clothing) + if(clothing.body_parts_covered & FEET) + return FALSE // If didn't stop before, then we're barefoot return TRUE