fixes strange object parrots spawning with headsets oversight (#68530)

* Parrots spawned by strange objects no longer spawn with headsets, generating infinite headset keys.
This commit is contained in:
Salex08
2022-07-20 21:17:28 -04:00
committed by GitHub
parent 2314736821
commit f9d8cd8ee5
2 changed files with 15 additions and 9 deletions
@@ -84,6 +84,9 @@
//Headset for Poly to yell at engineers :)
var/obj/item/radio/headset/ears = null
//Wheter the Parrot should come with a headset
var/spawn_headset = TRUE
//The thing the parrot is currently interested in. This gets used for items the parrot wants to pick up, mobs it wants to steal from,
//mobs it wants to attack or mobs that have attacked it
var/atom/movable/parrot_interest = null
@@ -110,14 +113,6 @@
/mob/living/simple_animal/parrot/Initialize(mapload)
. = ..()
if(!ears)
var/headset = pick(/obj/item/radio/headset/headset_sec, \
/obj/item/radio/headset/headset_eng, \
/obj/item/radio/headset/headset_med, \
/obj/item/radio/headset/headset_sci, \
/obj/item/radio/headset/headset_cargo)
ears = new headset(src)
parrot_sleep_dur = parrot_sleep_max //In case someone decides to change the max without changing the duration var
add_verb(src, list(/mob/living/simple_animal/parrot/proc/steal_from_ground, \
@@ -129,6 +124,15 @@
AddElement(/datum/element/strippable, GLOB.strippable_parrot_items)
AddElement(/datum/element/simple_flying)
if(!spawn_headset)
return
if(!ears)
var/headset = pick(/obj/item/radio/headset/headset_sec, \
/obj/item/radio/headset/headset_eng, \
/obj/item/radio/headset/headset_med, \
/obj/item/radio/headset/headset_sci, \
/obj/item/radio/headset/headset_cargo)
ears = new headset(src)
/mob/living/simple_animal/parrot/examine(mob/user)
. = ..()
@@ -880,6 +884,8 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
to_chat(src, span_notice("You will now [combat_mode ? "Harm" : "Help"] others."))
return
/mob/living/simple_animal/parrot/natural
spawn_headset = FALSE
/*
* Sub-types
*/
+1 -1
View File
@@ -631,7 +631,7 @@
visible_message(message)
to_chat(user, message)
var/list/valid_animals = list(/mob/living/simple_animal/parrot, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/pet/cat, /mob/living/simple_animal/pet/dog/corgi, /mob/living/simple_animal/crab, /mob/living/simple_animal/pet/fox, /mob/living/simple_animal/hostile/lizard, /mob/living/simple_animal/mouse, /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/bee, /mob/living/simple_animal/hostile/carp)
var/list/valid_animals = list(/mob/living/simple_animal/parrot/natural, /mob/living/simple_animal/butterfly, /mob/living/simple_animal/pet/cat, /mob/living/simple_animal/pet/dog/corgi, /mob/living/simple_animal/crab, /mob/living/simple_animal/pet/fox, /mob/living/simple_animal/hostile/lizard, /mob/living/simple_animal/mouse, /mob/living/simple_animal/pet/dog/pug, /mob/living/simple_animal/hostile/bear, /mob/living/simple_animal/hostile/bee, /mob/living/simple_animal/hostile/carp)
for(var/counter in 1 to rand(1, 25))
var/mobType = pick(valid_animals)
new mobType(get_turf(src))