From 9c3e532be75c0de398889924a55fed9d2a02b463 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 9 Oct 2019 00:21:55 +0200 Subject: [PATCH 1/2] Fixes lack of arguments on mobs' can_equip. --- code/modules/mob/inventory.dm | 2 +- code/modules/mob/living/carbon/monkey/inventory.dm | 2 +- .../mob/living/simple_animal/friendly/drone/inventory.dm | 2 +- .../modules/mob/living/simple_animal/guardian/types/dextrous.dm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 9569d4826c..760fb7a29f 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -158,7 +158,7 @@ //Returns if a certain item can be equipped to a certain slot. // Currently invalid for two-handed items - call obj/item/mob_can_equip() instead. -/mob/proc/can_equip(obj/item/I, slot, disable_warning = 0) +/mob/proc/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE) return FALSE /mob/proc/can_put_in_hand(I, hand_index) diff --git a/code/modules/mob/living/carbon/monkey/inventory.dm b/code/modules/mob/living/carbon/monkey/inventory.dm index fdc28d13a0..d5fffc70a2 100644 --- a/code/modules/mob/living/carbon/monkey/inventory.dm +++ b/code/modules/mob/living/carbon/monkey/inventory.dm @@ -1,4 +1,4 @@ -/mob/living/carbon/monkey/can_equip(obj/item/I, slot, disable_warning = 0) +/mob/living/carbon/monkey/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE) switch(slot) if(SLOT_HANDS) if(get_empty_held_indexes()) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm index 3f344c2936..6e89f045da 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm @@ -19,7 +19,7 @@ return 0 -/mob/living/simple_animal/drone/can_equip(obj/item/I, slot) +/mob/living/simple_animal/drone/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE) switch(slot) if(SLOT_HEAD) if(head) 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 a43d4b6d5c..52a007e24c 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm @@ -52,7 +52,7 @@ return 1 return 0 -/mob/living/simple_animal/hostile/guardian/dextrous/can_equip(obj/item/I, slot) +/mob/living/simple_animal/hostile/guardian/dextrous/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE) switch(slot) if(SLOT_GENERC_DEXTROUS_STORAGE) if(internal_storage) From dac6fef57a9af0635abdb7931ba2f0d8bba360ea Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 9 Oct 2019 00:38:09 +0200 Subject: [PATCH 2/2] Also implementing /tg/station pr #40767 --- code/_onclick/hud/screen_objects.dm | 2 +- code/game/objects/items.dm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 4c666d708c..f796f75407 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -157,7 +157,7 @@ var/image/item_overlay = image(holding) item_overlay.alpha = 92 - if(!user.can_equip(holding, slot_id, disable_warning = TRUE)) + if(!user.can_equip(holding, slot_id, TRUE)) item_overlay.color = "#FF0000" else item_overlay.color = "#00ff00" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c98cef2b87..c8614ba7d6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -421,10 +421,10 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) //the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. //if this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. //If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. -//Set disable_warning to 1 if you wish it to not give you outputs. +//Set disable_warning to TRUE if you wish it to not give you outputs. /obj/item/proc/mob_can_equip(mob/living/M, mob/living/equipper, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE) if(!M) - return 0 + return FALSE return M.can_equip(src, slot, disable_warning, bypass_equip_delay_self)