Files
CHOMPStation2/code/datums/observation/unequipped.dm
CHOMPStation2 608075a2ae [MIRROR] Fix a small runtime in actions when dropping rigs (#9271)
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
2024-10-20 19:39:17 +02:00

46 lines
1.4 KiB
Plaintext

// Observer Pattern Implementation: Unequipped (dropped)
// Registration type: /mob
//
// Raised when: A mob unequips/drops an item.
//
// Arguments that the called proc should expect:
// /mob/equipped: The mob that unequipped/dropped the item.
// /obj/item/item: The unequipped item.
/*
GLOBAL_DATUM_INIT(mob_unequipped_event, /decl/observ/mob_unequipped, new)
/decl/observ/mob_unequipped
name = "Mob Unequipped"
expected_type = /mob
// Observer Pattern Implementation: Unequipped (dropped)
// Registration type: /obj/item
//
// Raised when: A mob unequips/drops an item.
//
// Arguments that the called proc should expect:
// /obj/item/item: The unequipped item.
// /mob/equipped: The mob that unequipped/dropped the item.
GLOBAL_DATUM_INIT(item_unequipped_event, /decl/observ/item_unequipped, new)
/decl/observ/item_unequipped
name = "Item Unequipped"
expected_type = /obj/item
*/
//Deprecated in favor of comsigs
/**********************
* Unequipped Handling *
**********************/
/obj/item/dropped(var/mob/user)
. = ..(user)
//SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_UNEQUIPPED, src)
//SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED, user)
if(user) // Cannot always guarantee that user won't be null
SEND_SIGNAL(user, COMSIG_OBSERVER_MOB_UNEQUIPPED, src)
SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED, user)
else
SEND_SIGNAL(src, COMSIG_OBSERVER_ITEM_UNEQUIPPED)