Resolves issue 594 - You can no longer use Mech-drills/clamps/etc to interact with your hud items.

Fixed an old feature that diverted clicks on a hud inventory-slot (say, the place you put your bag) to the object in that slot (i.e. making it easier to click small items and also making it possible to remove things that have borked and turned invisible

Fixed admins being able to change their own rank via chgadlvl.

Insignificant tweaks to DblClick() just removed some useless bits near the top.

Known issues:
Can't put straight jackets on aliums anymore for some reason
Aliums can remove straight jackets from themselves.
Can still mecha-drill a few things you shouldn't be able to >_>

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4032 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-07-11 07:48:14 +00:00
parent ff2ac76177
commit f92bec2a22
10 changed files with 134 additions and 230 deletions

View File

@@ -347,19 +347,17 @@
/atom/Click(location,control,params) /atom/Click(location,control,params)
//world << "atom.Click() on [src] by [usr] : src.type is [src.type]" //world << "atom.Click() on [src] by [usr] : src.type is [src.type]"
if(usr.client.buildmode) if(usr.client.buildmode)
build_click(usr, usr.client.buildmode, location, control, params, src) build_click(usr, usr.client.buildmode, location, control, params, src)
return return
// if(using_new_click_proc) //TODO ERRORAGE (see message below)
if(using_new_click_proc) //TODO ERRORAGE (see message below) // return DblClickNew()
return DblClickNew()
return DblClick(location, control, params) return DblClick(location, control, params)
var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblClickNew() proc is being tested) var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblClickNew() proc is being tested)
/atom/proc/DblClickNew() /atom/proc/DblClickNew()
if(!usr) return
// TODO DOOHL: Intergrate params to new proc. Saved for another time because var/valid_place is a fucking brainfuck // TODO DOOHL: Intergrate params to new proc. Saved for another time because var/valid_place is a fucking brainfuck
//Spamclick server-overloading prevention delay... THING //Spamclick server-overloading prevention delay... THING
@@ -649,8 +647,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
attack_animal(animal) attack_animal(animal)
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE /atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
// world << "checking if this shit gets called at all" if(!usr) return
// ------- TIME SINCE LAST CLICK ------- // ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1) if (world.time <= usr:lastDblClick+1)
@@ -660,51 +657,49 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
// world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]" // world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]"
usr:lastDblClick = world.time usr:lastDblClick = world.time
// ------- DIR CHANGING WHEN CLICKING (changes facting direction) ------ //Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
if( usr && iscarbon(usr) && !usr.buckled ) // ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y ) if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x var/dx = src.x - usr.x
var/dy = src.y - usr.y var/dy = src.y - usr.y
if( dy > 0 && abs(dx) < dy ) //North if(dy || dx)
usr.dir = 1 if(abs(dx) < abs(dy))
if( dy < 0 && abs(dx) < abs(dy) ) //South if(dy > 0) usr.dir = NORTH
usr.dir = 2 else usr.dir = SOUTH
if( dx > 0 && abs(dy) <= dx ) //East else
usr.dir = 4 if(dx > 0) usr.dir = EAST
if( dx < 0 && abs(dy) <= abs(dx) ) //West else usr.dir = WEST
usr.dir = 8 else
if( dx == 0 && dy == 0 ) if(pixel_y > 16) usr.dir = NORTH
if(src.pixel_y > 16) else if(pixel_y < -16) usr.dir = SOUTH
usr.dir = 1 else if(pixel_x > 16) usr.dir = EAST
if(src.pixel_y < -16) else if(pixel_x < -16) usr.dir = WEST
usr.dir = 2
if(src.pixel_x > 16)
usr.dir = 4
if(src.pixel_x < -16)
usr.dir = 8
// ------- AI ------- // ------- AI -------
if (istype(usr, /mob/living/silicon/ai)) else if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled) if (ai.control_disabled)
return return
// ------- CYBORG ------- // ------- CYBORG -------
if (istype (usr, /mob/living/silicon/robot)) else if (istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return if (bot.lockcharge) return
..() ..()
// ------- SHIFT-CLICK ------- // ------- SHIFT-CLICK -------
if(params) if(params)
@@ -736,7 +731,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
else else
AICtrlClick(usr) AICtrlClick(usr)
return return
} }
// ------- MIDDLE-CLICK ------- // ------- MIDDLE-CLICK -------
@@ -752,17 +747,16 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
// ------- ITEM IN HAND DEFINED ------- // ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand() var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT ------- // ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot)) if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active)) if(!isnull(usr:module_active))
W = usr:module_active W = usr:module_active
else else
W = null W = null
*/
// ------- ATTACK SELF ------- // ------- ATTACK SELF -------
if (W == src && usr.stat == 0) if (W == src && usr.stat == 0)
// spawn (0) //would cause a runtime if W was deconstructed during a lagspike
W.attack_self(usr) W.attack_self(usr)
if(usr.hand) if(usr.hand)
usr.update_inv_l_hand() //update in-hand overlays usr.update_inv_l_hand() //update in-hand overlays
@@ -784,19 +778,15 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
return return
// ------- 1 TILE AWAY ------- // ------- 1 TILE AWAY -------
var/t5 = in_range(src, usr) || src.loc == usr var/t5
// ------- AI CAN CLICK ANYTHING ------- // ------- AI CAN CLICK ANYTHING -------
if (istype(usr, /mob/living/silicon/ai)) if(istype(usr, /mob/living/silicon/ai))
t5 = 1 t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF ------- // ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
if ((istype(usr, /mob/living/silicon/robot)) && W == null) else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1 t5 = 1
else
// ------- CLICKING ON ORGANS ------- t5 = in_range(src, usr) || src.loc == usr
if (istype(src, /datum/organ) && src in usr.contents)
return
// world << "according to dblclick(), t5 is [t5]" // world << "according to dblclick(), t5 is [t5]"

View File

@@ -82,12 +82,12 @@
return 0 return 0
if(!chassis) if(!chassis)
return 0 return 0
if(energy_drain && !chassis.has_charge(energy_drain))
return 0
if(!equip_ready) if(!equip_ready)
return 0 return 0
if(crit_fail) if(crit_fail)
return 0 return 0
if(energy_drain && !chassis.has_charge(energy_drain))
return 0
return 1 return 1
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target) /obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)

View File

@@ -73,6 +73,9 @@
action(atom/target) action(atom/target)
if(!action_checks(target)) return if(!action_checks(target)) return
if(isobj(target))
var/obj/target_obj = target
if(target_obj.unacidable) return
set_ready_state(0) set_ready_state(0)
chassis.use_power(energy_drain) chassis.use_power(energy_drain)
chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.") chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.")
@@ -127,6 +130,9 @@
action(atom/target) action(atom/target)
if(!action_checks(target)) return if(!action_checks(target)) return
if(isobj(target))
var/obj/target_obj = target
if(target_obj.unacidable) return
set_ready_state(0) set_ready_state(0)
chassis.use_power(energy_drain) chassis.use_power(energy_drain)
chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.") chassis.visible_message("<font color='red'><b>[chassis] starts to drill [target]</b></font>", "You hear the drill.")

View File

@@ -195,14 +195,14 @@
//////////////////////////// ////////////////////////////
///// Action processing //// ///// Action processing ////
//////////////////////////// ////////////////////////////
/*
/client/Click(object,location,control,params) /atom/DblClick(object,location,control,params)
var/mob/M = src.mob var/mob/M = src.mob
if(M && M.in_contents_of(/obj/mecha)) if(M && M.in_contents_of(/obj/mecha))
/*
if(mech_click == world.time) return if(mech_click == world.time) return
mech_click = world.time mech_click = world.time
*/
if(!istype(object, /atom)) return if(!istype(object, /atom)) return
if(istype(object, /obj/screen)) if(istype(object, /obj/screen))
var/obj/screen/using = object var/obj/screen/using = object
@@ -214,8 +214,9 @@
spawn() //this helps prevent clickspam fest. spawn() //this helps prevent clickspam fest.
if (Mech) if (Mech)
Mech.click_action(object,M) Mech.click_action(object,M)
else // else
return ..() // return ..()
*/
/obj/mecha/proc/click_action(atom/target,mob/user) /obj/mecha/proc/click_action(atom/target,mob/user)
if(!src.occupant || src.occupant != user ) return if(!src.occupant || src.occupant != user ) return

View File

@@ -4,14 +4,6 @@
icon = 'alien.dmi' icon = 'alien.dmi'
// unacidable = 1 //Aliens won't ment their own. // unacidable = 1 //Aliens won't ment their own.
/obj/effect/alien/head
name = "severed head"
desc = "a severed head..."
icon_state = "weeds"
density = 0
anchored = 0
/obj/effect/alien/resin /obj/effect/alien/resin
name = "resin" name = "resin"
desc = "Looks like some kind of slimy growth." desc = "Looks like some kind of slimy growth."

View File

@@ -1417,6 +1417,7 @@ var/global/BSACooldown = 0
//change admin level //change admin level
var/rank = href_list["chgadlvl"] var/rank = href_list["chgadlvl"]
var/client/C = locate(href_list["client4ad"]) var/client/C = locate(href_list["client4ad"])
if(!istype(C)) return
if(rank == "Remove") if(rank == "Remove")
C.clear_admin_verbs() C.clear_admin_verbs()
C.update_admins(null) C.update_admins(null)
@@ -1424,6 +1425,9 @@ var/global/BSACooldown = 0
message_admins("[key_name_admin(usr)] has removed [C]'s adminship", 1) message_admins("[key_name_admin(usr)] has removed [C]'s adminship", 1)
admins.Remove(C.ckey) admins.Remove(C.ckey)
else else
if(C == owner) //no promoting/demoting yourself
message_admins("[C] tried to change their own admin-rank >:(")
return
C.clear_admin_verbs() C.clear_admin_verbs()
C.update_admins(rank) C.update_admins(rank)
log_admin("[key_name(usr)] has made [C] a [rank]") log_admin("[key_name(usr)] has made [C] a [rank]")

View File

@@ -66,7 +66,7 @@
/mob/proc/drop_item_v() //this is dumb. /mob/proc/drop_item_v() //this is dumb.
if(stat == CONSCIOUS) if(stat == CONSCIOUS && isturf(loc))
return drop_item() return drop_item()
return 0 return 0

View File

@@ -21,60 +21,34 @@
/mob/living/carbon/alien/humanoid/db_click(text, t1) /mob/living/carbon/alien/humanoid/db_click(text, t1)
var/obj/item/W = get_active_hand() var/obj/item/W = get_active_hand()
var/emptyHand = (W == null) if(W && !istype(W))
if ((!emptyHand) && (!istype(W, /obj/item)))
return return
if (emptyHand)
usr.next_move = usr.prev_move
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
switch(text) switch(text)
//if emptyhand then wear the suit, no bedsheet clothes for the alien
if("o_clothing") if("o_clothing")
if (wear_suit) if(wear_suit)
if (emptyHand) if(!W) wear_suit.attack_alien(src)
wear_suit.DblClick()
// else
// update_inv_wear_suit()
return
/* if (!( istype(W, /obj/item/clothing/suit) ))
return return
u_equip(W) return
wear_suit = W
W.get_active_hand(src, text)
*/
if("head") if("head")
if (head) if(head)
if (emptyHand) if(!W) head.attack_alien(src)
head.DblClick() return
else if (( istype(W, /obj/effect/alien/head) )) //TODO: figure out wtf this is about ~Carn
u_equip(W)
head = W
update_inv_head()
return return
/* if (!( istype(W, /obj/item/clothing/head) ))
return
u_equip(W)
head = W
W.get_active_hand(src, text)
*/
if("storage1") if("storage1")
if (l_store) if(l_store)
if (emptyHand) if(!W) l_store.attack_alien(src)
l_store.DblClick()
return return
if ((!( istype(W, /obj/item) ) || W.w_class > 3)) if(W.w_class > 3)
return return
u_equip(W) u_equip(W)
l_store = W l_store = W
update_inv_pockets() update_inv_pockets()
if("storage2") if("storage2")
if (r_store) if(r_store)
if (emptyHand) if(!W) r_store.attack_alien(src)
r_store.DblClick()
return return
if ((!( istype(W, /obj/item) ) || W.w_class > 3)) if(W.w_class > 3)
return return
u_equip(W) u_equip(W)
r_store = W r_store = W

View File

@@ -1013,65 +1013,41 @@ It can still be worn/put on as normal.
/mob/living/carbon/human/db_click(text, t1) /mob/living/carbon/human/db_click(text, t1)
var/obj/item/W = get_active_hand() var/obj/item/W = get_active_hand()
var/emptyHand = (W == null) if(W && !istype(W)) return
if(emptyHand)
usr.next_move = usr.prev_move
usr:lastDblClick -= 3 //permit the double-click redirection to proceed.
else
if( !istype(W, /obj/item) ) return
switch(text) switch(text)
if("mask") if("mask")
if(wear_mask) if(wear_mask)
if(emptyHand) if(!W) wear_mask.attack_hand(src)
wear_mask.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_MASK) )
return
if (!( W.slot_flags & SLOT_MASK ))
return return
u_equip(W) u_equip(W)
wear_mask = W wear_mask = W
if(wear_mask && (wear_mask.flags & BLOCKHAIR)) if(wear_mask.flags & BLOCKHAIR)
update_hair(0) //rebuild hair update_hair(0) //rebuild hair
W.equipped(src, text) W.equipped(src, text)
update_inv_wear_mask() update_inv_wear_mask()
if("back") if("back")
if (back) if(back)
if (emptyHand) if(!W) back.attack_hand(src)
back.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_BACK) )
return return
if (!( W.slot_flags & SLOT_BACK )) if(istype(W,/obj/item/weapon/twohanded) && W:wielded) //TODO
return
if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>" usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>"
return return
u_equip(W) u_equip(W)
back = W back = W
W.equipped(src, text) W.equipped(src, text)
update_inv_back() update_inv_back()
/* if("headset")
if (ears)
if (emptyHand)
ears.DblClick()
return
if (!( istype(W, /obj/item/device/radio/headset) ))
return
u_equip(W)
w_radio = W
W.equipped(src, text) */
if("o_clothing") if("o_clothing")
if (wear_suit) if(wear_suit)
if (emptyHand) if(!W) wear_suit.attack_hand(src)
wear_suit.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_OCLOTHING) )
return return
if (!( W.slot_flags & SLOT_OCLOTHING )) if( !(W.flags & ONESIZEFITSALL) && (FAT in mutations) )
return
if ((FAT in src.mutations) && !(W.flags & ONESIZEFITSALL))
src << "\red You're too fat to wear the [W.name]!" src << "\red You're too fat to wear the [W.name]!"
return return
u_equip(W) u_equip(W)
@@ -1079,100 +1055,78 @@ It can still be worn/put on as normal.
W.equipped(src, text) W.equipped(src, text)
update_inv_wear_suit() update_inv_wear_suit()
if("gloves") if("gloves")
if (gloves) if(gloves)
if (emptyHand) if(!W) gloves.attack_hand(src)
gloves.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_GLOVES) )
return
if (!( W.slot_flags & SLOT_GLOVES ))
return return
u_equip(W) u_equip(W)
gloves = W gloves = W
W.equipped(src, text) W.equipped(src, text)
update_inv_gloves() update_inv_gloves()
if("shoes") if("shoes")
if (shoes) if(shoes)
if (emptyHand) if(!W) shoes.attack_hand(src)
shoes.DblClick()
return return
if (!istype(W, /obj/item)) if( !( W.slot_flags & SLOT_FEET) )
return
if (!( W.slot_flags & SLOT_FEET ))
return return
u_equip(W) u_equip(W)
shoes = W shoes = W
W.equipped(src, text) W.equipped(src, text)
update_inv_shoes() update_inv_shoes()
if("belt") if("belt")
if (belt) if(belt)
if (emptyHand) if(!W) belt.attack_hand(src)
belt.DblClick()
return return
if (!w_uniform) if(!w_uniform)
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_BELT) )
return
if (!( W.slot_flags & SLOT_BELT ))
return return
u_equip(W) u_equip(W)
belt = W belt = W
W.equipped(src, text) W.equipped(src, text)
update_inv_belt() update_inv_belt()
if("eyes") if("eyes")
if (glasses) if(glasses)
if (emptyHand) if(!W) glasses.attack_hand(src)
glasses.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_EYES) )
return
if (!( W.slot_flags & SLOT_EYES ))
return return
u_equip(W) u_equip(W)
glasses = W glasses = W
W.equipped(src, text) W.equipped(src, text)
update_inv_glasses() update_inv_glasses()
if("head") if("head")
if (head) if(head)
if (emptyHand) if(!W) head.attack_hand(src)
head.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_HEAD) )
return
if (!( W.slot_flags & SLOT_HEAD ))
return return
u_equip(W) u_equip(W)
head = W head = W
if(head.flags & BLOCKHAIR) if(head.flags & BLOCKHAIR)
//rebuild hair update_hair(0) //rebuild hair
update_hair(0)
if(istype(W,/obj/item/clothing/head/kitty)) if(istype(W,/obj/item/clothing/head/kitty))
W.update_icon(src) W.update_icon(src)
W.equipped(src, text) W.equipped(src, text)
update_inv_head() update_inv_head()
if("ears") if("ears")
if (ears) if(ears)
if (emptyHand) if(!W) ears.attack_hand(src)
ears.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_EARS) )
return
if (!( W.slot_flags & SLOT_EARS ))
return return
u_equip(W) u_equip(W)
ears = W ears = W
W.equipped(src, text) W.equipped(src, text)
update_inv_ears() update_inv_ears()
if("i_clothing") if("i_clothing")
if (w_uniform) if(w_uniform)
if (emptyHand) if(!W) w_uniform.attack_hand(src)
w_uniform.DblClick()
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_ICLOTHING) )
return return
if (!( W.slot_flags & SLOT_ICLOTHING )) if( !(W.flags & ONESIZEFITSALL) && (FAT in src.mutations) )
return
if ((FAT in src.mutations) && !(W.flags & ONESIZEFITSALL))
src << "\red You're too fat to wear the [W.name]!" src << "\red You're too fat to wear the [W.name]!"
return return
u_equip(W) u_equip(W)
@@ -1180,66 +1134,51 @@ It can still be worn/put on as normal.
W.equipped(src, text) W.equipped(src, text)
update_inv_w_uniform() update_inv_w_uniform()
if("id") if("id")
if (wear_id) if(wear_id)
if (emptyHand) if(!W) wear_id.attack_hand(src)
wear_id.DblClick()
return return
if (!w_uniform) if(!w_uniform)
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_ID) )
return
if (!( W.slot_flags & SLOT_ID ))
return return
u_equip(W) u_equip(W)
wear_id = W wear_id = W
W.equipped(src, text) W.equipped(src, text)
update_inv_wear_id() update_inv_wear_id()
if("storage1") if("storage1")
if (l_store) if(l_store)
if (emptyHand) if(!W) l_store.attack_hand(src)
l_store.DblClick()
return return
if (!w_uniform) if(!w_uniform)
return return
if (!istype(W, /obj/item)) if(W.slot_flags & SLOT_DENYPOCKET)
return return
if ( ( W.slot_flags & SLOT_DENYPOCKET ) ) if( W.w_class <= 2 || (W.slot_flags & SLOT_POCKET) )
return
if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) )
u_equip(W) u_equip(W)
l_store = W l_store = W
update_inv_pockets() update_inv_pockets()
if("storage2") if("storage2")
if (r_store) if(r_store)
if (emptyHand) if(!W) r_store.attack_hand(src)
r_store.DblClick()
return return
if (!w_uniform) if(!w_uniform)
return return
if (!istype(W, /obj/item)) if(W.slot_flags & SLOT_DENYPOCKET)
return return
if ( ( W.slot_flags & SLOT_DENYPOCKET ) ) if( W.w_class <= 2 || (W.slot_flags & SLOT_POCKET) )
return
if ( W.w_class <= 2 || ( W.slot_flags & SLOT_POCKET ) )
u_equip(W) u_equip(W)
r_store = W r_store = W
update_inv_pockets() update_inv_pockets()
if("suit storage") if("suit storage")
if (s_store) if(s_store)
if (emptyHand) if(!W) s_store.attack_hand(src)
s_store.DblClick()
return return
var/confirm if(!wear_suit)
if (wear_suit) return
if(!wear_suit.allowed) if(!wear_suit.allowed)
usr << "You somehow have a suit with no defined allowed items for suit storage, stop that." usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
return return
if (istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen)) if( istype(W, /obj/item/device/pda) || istype(W, /obj/item/weapon/pen) || is_type_in_list(W, wear_suit.allowed) )
confirm = 1
if (is_type_in_list(W, wear_suit.allowed))
confirm = 1
if (!confirm) return
else
u_equip(W) u_equip(W)
s_store = W s_store = W
update_inv_s_store() update_inv_s_store()

View File

@@ -108,32 +108,30 @@
//Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn //Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn
/mob/proc/db_click(text, t1) /mob/proc/db_click(text, t1)
var/obj/item/weapon/W = get_active_hand() var/obj/item/W = get_active_hand()
if(W && !istype(W)) return
switch(text) switch(text)
if("mask") if("mask")
if (wear_mask) if(wear_mask)
return return
if (!( W.slot_flags & SLOT_MASK )) if( !(W.slot_flags & SLOT_MASK) )
return return
u_equip(W) u_equip(W)
wear_mask = W wear_mask = W
W.equipped(src, text) W.equipped(src, text)
update_inv_wear_mask() update_inv_wear_mask()
if("back") if("back")
if (back) if(back)
return return
if (!istype(W, /obj/item)) if( !(W.slot_flags & SLOT_BACK) )
return return
if (!( W.slot_flags & SLOT_BACK )) if( istype(W,/obj/item/weapon/twohanded) && W:wielded ) //TODO: Carn
return
if(istype(W,/obj/item/weapon/twohanded) && W:wielded)
usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>" usr << "<span class='warning'>Unwield the [initial(W.name)] first!</span>"
return return
u_equip(W) u_equip(W)
back = W back = W
W.equipped(src, text) W.equipped(src, text)
update_inv_back() update_inv_back()
return return
/mob/proc/reset_view(atom/A) /mob/proc/reset_view(atom/A)