Skip to content

Commit

Permalink
Dogs no longer take whatever they're holding/wearing to the grave (tg…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryll-Ryll authored Mar 24, 2021
1 parent 109617a commit f6848c6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
10 changes: 8 additions & 2 deletions code/datums/ai/dog/dog_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@
RegisterSignal(new_pawn, COMSIG_ATOM_ATTACK_HAND, .proc/on_attack_hand)
RegisterSignal(new_pawn, COMSIG_PARENT_EXAMINE, .proc/on_examined)
RegisterSignal(new_pawn, COMSIG_CLICK_ALT, .proc/check_altclicked)
RegisterSignal(new_pawn, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_QDELETING), .proc/on_death)
RegisterSignal(SSdcs, COMSIG_GLOB_CARBON_THROW_THING, .proc/listened_throw)
return ..() //Run parent at end

/datum/ai_controller/dog/UnpossessPawn(destroy)
UnregisterSignal(pawn, list(COMSIG_ATOM_ATTACK_HAND, COMSIG_PARENT_EXAMINE, COMSIG_GLOB_CARBON_THROW_THING, COMSIG_CLICK_ALT))
var/obj/item/carried_item = blackboard[BB_SIMPLE_CARRY_ITEM]
if(carried_item)
pawn.visible_message("<span='danger'>[pawn] drops [carried_item].</span>")
carried_item.forceMove(pawn.drop_location())
blackboard[BB_SIMPLE_CARRY_ITEM] = null
UnregisterSignal(pawn, list(COMSIG_ATOM_ATTACK_HAND, COMSIG_PARENT_EXAMINE, COMSIG_CLICK_ALT, COMSIG_LIVING_DEATH, COMSIG_GLOB_CARBON_THROW_THING, COMSIG_PARENT_QDELETING))
return ..() //Run parent at end

/datum/ai_controller/dog/able_to_run()
Expand Down Expand Up @@ -197,7 +203,7 @@
return

ol_yeller.visible_message("<span='danger'>[ol_yeller] drops [carried_item] as [ol_yeller.p_they()] die[ol_yeller.p_s()].</span>")
carried_item.forceMove(get_turf(ol_yeller))
carried_item.forceMove(ol_yeller.drop_location())
blackboard[BB_SIMPLE_CARRY_ITEM] = null

// next section is regarding commands
Expand Down
11 changes: 10 additions & 1 deletion code/modules/mob/living/simple_animal/friendly/dog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
QDEL_NULL(inventory_back)
return ..()

/mob/living/simple_animal/pet/dog/corgi/gib()
if(inventory_head)
inventory_head.forceMove(drop_location())
inventory_head = null
if(inventory_back)
inventory_back.forceMove(drop_location())
inventory_back = null
return ..()

/mob/living/simple_animal/pet/dog/corgi/handle_atom_del(atom/A)
if(A == inventory_head)
inventory_head = null
Expand Down Expand Up @@ -569,7 +578,7 @@
//puppies cannot wear anything.
/mob/living/simple_animal/pet/dog/corgi/puppy/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
to_chat(usr, "<span class='warning'>You can't fit this on [src]!</span>")
to_chat(usr, "<span class='warning'>You can't fit this on [src], [p_they()] [p_are()] too small!</span>")
return
..()

Expand Down
18 changes: 11 additions & 7 deletions code/modules/mob/living/simple_animal/friendly/pet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@

/mob/living/simple_animal/pet/Destroy()
QDEL_NULL(pcollar)
QDEL_NULL(access_card)
return ..()

/mob/living/simple_animal/pet/gib()
if(pcollar)
pcollar.forceMove(drop_location())
pcollar = null
if(access_card)
access_card.forceMove(drop_location())
access_card = null
return ..()

/mob/living/simple_animal/pet/revive(full_heal = FALSE, admin_revive = FALSE)
Expand All @@ -53,17 +63,11 @@
regenerate_icons()

/mob/living/simple_animal/pet/death(gibbed)
..(gibbed)
. = ..()
if(collar_type)
collar_type = "[initial(collar_type)]_dead"
regenerate_icons()

/mob/living/simple_animal/pet/gib()
if(pcollar)
pcollar.forceMove(drop_location())
pcollar = null
..()

/mob/living/simple_animal/pet/regenerate_icons()
cut_overlays()
if(pcollar && collar_type)
Expand Down

0 comments on commit f6848c6

Please sign in to comment.