From 558b87ce65ca53b5e3b2b7d9644695b2ccbea277 Mon Sep 17 00:00:00 2001 From: Cruix Date: Mon, 19 Feb 2018 13:04:26 -0800 Subject: [PATCH] Fixed instant summon behavior with simple animals (#35780) Removed hand slots from lots of things that should not have them --- code/modules/antagonists/devil/true_devil/_true_devil.dm | 7 ++++--- code/modules/mob/inventory.dm | 2 ++ code/modules/mob/living/carbon/carbon_defines.dm | 1 + .../mob/living/simple_animal/friendly/drone/_drone.dm | 1 + .../mob/living/simple_animal/guardian/types/dextrous.dm | 1 + code/modules/mob/living/simple_animal/simple_animal.dm | 2 +- code/modules/mob/mob_defines.dm | 2 +- code/modules/spells/spell_types/summonitem.dm | 2 +- 8 files changed, 12 insertions(+), 6 deletions(-) diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index 6f448a28fb..ad01e1edbd 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -14,15 +14,16 @@ ventcrawler = VENTCRAWLER_NONE density = TRUE pass_flags = 0 - var/ascended = FALSE sight = (SEE_TURFS | SEE_OBJS) status_flags = CANPUSH spacewalk = TRUE mob_size = MOB_SIZE_LARGE - var/mob/living/oldform - var/list/devil_overlays[DEVIL_TOTAL_LAYERS] + held_items = list(null, null) bodyparts = list(/obj/item/bodypart/chest/devil, /obj/item/bodypart/head/devil, /obj/item/bodypart/l_arm/devil, /obj/item/bodypart/r_arm/devil, /obj/item/bodypart/r_leg/devil, /obj/item/bodypart/l_leg/devil) + var/ascended = FALSE + var/mob/living/oldform + var/list/devil_overlays[DEVIL_TOTAL_LAYERS] /mob/living/carbon/true_devil/Initialize() create_bodyparts() //initialize bodyparts diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index ee21d21bb5..1884a97985 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -162,6 +162,8 @@ return FALSE /mob/proc/can_put_in_hand(I, hand_index) + if(hand_index > held_items.len) + return FALSE if(!put_in_hand_check(I)) return FALSE if(!has_hand_for_held_index(hand_index)) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 9efb72ba77..c03ff53b71 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -4,6 +4,7 @@ possible_a_intents = list(INTENT_HELP, INTENT_HARM) hud_possible = list(HEALTH_HUD,STATUS_HUD,ANTAG_HUD,GLAND_HUD) has_limbs = 1 + held_items = list(null, null) var/list/stomach_contents = list() var/list/internal_organs = list() //List of /obj/item/organ in the mob. They don't go in the contents for some reason I don't want to know. var/list/internal_organs_slot= list() //Same as above, but stores "slot ID" - "organ" pairs for easy access. diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index ea4bb1d089..f52a647649 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -49,6 +49,7 @@ dextrous_hud_type = /datum/hud/dextrous/drone lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE can_be_held = TRUE + held_items = list(null, null) var/staticChoice = "static" var/list/staticChoices = list("static", "blank", "letter", "animal") var/picked = FALSE //Have we picked our visual appearence (+ colour if applicable) diff --git a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm index f36a30ccae..713a71ac9b 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm @@ -8,6 +8,7 @@ tech_fluff_string = "Boot sequence complete. Dextrous combat modules loaded. Holoparasite swarm online." carp_fluff_string = "CARP CARP CARP! You caught one! It can hold stuff in its fins, sort of." dextrous = 1 + held_items = list(null, null) environment_target_typecache = list( /obj/machinery/door/window, /obj/structure/window, diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 61105fc046..4af34f1142 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -508,7 +508,7 @@ H.update_icon() /mob/living/simple_animal/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE) - ..(I, del_on_fail, merge_stacks) + . = ..(I, del_on_fail, merge_stacks) update_inv_hands() /mob/living/simple_animal/update_inv_hands() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index d5bc46c029..d4bebd6303 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -57,7 +57,7 @@ //Hands var/active_hand_index = 1 - var/list/held_items = list(null, null) //len = number of hands, eg: 2 nulls is 2 empty hands, 1 item and 1 null is 1 full hand and 1 empty hand. + var/list/held_items = list() //len = number of hands, eg: 2 nulls is 2 empty hands, 1 item and 1 null is 1 full hand and 1 empty hand. //held_items[active_hand_index] is the actively held item, but please use get_active_held_item() instead, because OOP var/obj/item/storage/s_active = null//Carbon diff --git a/code/modules/spells/spell_types/summonitem.dm b/code/modules/spells/spell_types/summonitem.dm index 7f5fc337b1..ab7702fcce 100644 --- a/code/modules/spells/spell_types/summonitem.dm +++ b/code/modules/spells/spell_types/summonitem.dm @@ -101,7 +101,7 @@ if(item_to_retrieve.loc) item_to_retrieve.loc.visible_message("The [item_to_retrieve.name] suddenly disappears!") if(!L.put_in_hands(item_to_retrieve)) - item_to_retrieve.forceMove(L.loc) + item_to_retrieve.forceMove(L.drop_location()) item_to_retrieve.loc.visible_message("The [item_to_retrieve.name] suddenly appears!") playsound(get_turf(L), 'sound/magic/summonitems_generic.ogg', 50, 1) else