From db2e6d5c605e978fa42402d44773f47cf9fac0ef Mon Sep 17 00:00:00 2001 From: Matthew Kelley Date: Thu, 27 Jul 2017 00:24:38 -0500 Subject: [PATCH 1/5] Pets with ID's in collars can now open approppriate doors --- code/game/machinery/doors/door.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 2b2039c9743..98248165532 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,8 +77,14 @@ var/mob/living/M = AM if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. M.last_bumped = world.time - if(!M.restrained() && M.mob_size > MOB_SIZE_SMALL) - bumpopen(M) + if(!M.restrained()) + if(istype(AM, /mob/living/simple_animal)) + var/mob/living/simple_animal/A = AM + if(ispet(AM) && A.collar) + bumpopen(M) + else + if(M.mob_size > MOB_SIZE_SMALL) + bumpopen(M) return if(istype(AM, /obj/mecha)) From bc26f1feb6883cb86360028ff47575e24b28da4b Mon Sep 17 00:00:00 2001 From: Matthew Kelley Date: Mon, 21 Aug 2017 01:42:48 -0500 Subject: [PATCH 2/5] Using isanimal helper proc --- code/game/machinery/doors/door.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 9b02d45e371..9e2687f0793 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,7 +77,7 @@ if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. M.last_bumped = world.time if(!M.restrained()) - if(istype(AM, /mob/living/simple_animal)) + if(isanimal(AM)) var/mob/living/simple_animal/A = AM if(ispet(AM) && A.collar) bumpopen(M) From fbefd5c7c26d791a6baff4f13a76de8b5573ab6c Mon Sep 17 00:00:00 2001 From: Matthew Kelley Date: Thu, 24 Aug 2017 02:52:34 -0500 Subject: [PATCH 3/5] Removed isanimal in favor of one ispet type check --- code/game/machinery/doors/door.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 9e2687f0793..a10c1bc1c91 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,9 +77,9 @@ if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. M.last_bumped = world.time if(!M.restrained()) - if(isanimal(AM)) + if(ispet(AM)) var/mob/living/simple_animal/A = AM - if(ispet(AM) && A.collar) + if(A.collar) bumpopen(M) else if(M.mob_size > MOB_SIZE_SMALL) From 91a82681f3bdb724e0b0217ef5242baa1917ea4b Mon Sep 17 00:00:00 2001 From: Matthew Kelley Date: Sat, 26 Aug 2017 15:55:52 -0500 Subject: [PATCH 4/5] door code else if to one line, using M instead of AM --- code/game/machinery/doors/door.dm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index a10c1bc1c91..1ff4f6742db 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,13 +77,12 @@ if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. M.last_bumped = world.time if(!M.restrained()) - if(ispet(AM)) + if(ispet(M)) var/mob/living/simple_animal/A = AM if(A.collar) bumpopen(M) - else - if(M.mob_size > MOB_SIZE_SMALL) - bumpopen(M) + else if(M.mob_size > MOB_SIZE_SMALL) + bumpopen(M) return if(istype(AM, /obj/mecha)) From cef2981f994c1d62e067e0a89c1df19b0c256a32 Mon Sep 17 00:00:00 2001 From: Matthew Kelley Date: Thu, 31 Aug 2017 01:35:26 -0500 Subject: [PATCH 5/5] Future proofing for BIG-ish pets --- code/game/machinery/doors/door.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 1ff4f6742db..4f68c721c1c 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,12 +77,12 @@ if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent shock spam. M.last_bumped = world.time if(!M.restrained()) - if(ispet(M)) + if(M.mob_size > MOB_SIZE_SMALL) + bumpopen(M) + else if(ispet(M)) var/mob/living/simple_animal/A = AM if(A.collar) bumpopen(M) - else if(M.mob_size > MOB_SIZE_SMALL) - bumpopen(M) return if(istype(AM, /obj/mecha))