Merge pull request #4560 from Tastyfish/item-action-button-fix

Fixes holsters and potentially other accessories's action buttons
This commit is contained in:
Fox McCloud
2016-06-02 18:57:56 -04:00
7 changed files with 24 additions and 10 deletions
@@ -10,6 +10,7 @@
var/slot = "decor"
var/obj/item/clothing/under/has_suit = null //the suit the tie may be attached to
var/image/inv_overlay = null //overlay used when attached to clothing.
action_button_custom_type = /datum/action/item_action/accessory
/obj/item/clothing/accessory/New()
..()
+4 -6
View File
@@ -251,19 +251,17 @@
/mob/living/proc/give_action_button(var/obj/item/I, recursive = 0)
if(I.action_button_name)
if(!I.action)
if(istype(I, /obj/item/organ/internal))
I.action = new/datum/action/item_action/organ_action
else if(I.action_button_is_hands_free)
I.action = new/datum/action/item_action/hands_free
if(I.action_button_custom_type)
I.action = new I.action_button_custom_type
else
I.action = new/datum/action/item_action
I.action = new /datum/action/item_action
I.action.name = I.action_button_name
I.action.target = I
I.action.Grant(src)
if(recursive)
for(var/obj/item/T in I)
give_action_button(I, recursive - 1)
give_action_button(T, recursive - 1)
/mob/living/update_action_buttons()
if(!hud_used) return
@@ -10,6 +10,7 @@
vital = 0
var/organ_action_name = null
var/non_primary = 0
action_button_custom_type = /datum/action/item_action/organ_action
/obj/item/organ/internal/New(var/mob/living/carbon/holder)
if(istype(holder))