Mob inventory cleanup

This commit is contained in:
Kelenius
2016-03-15 16:39:40 +03:00
parent 5104957ff8
commit afbc235b96
59 changed files with 432 additions and 390 deletions
+8 -13
View File
@@ -73,13 +73,10 @@
/obj/item/equipped()
..()
var/mob/M = loc
var/mob/living/M = loc
if(!istype(M))
return
if(M.l_hand)
M.l_hand.update_held_icon()
if(M.r_hand)
M.r_hand.update_held_icon()
M.update_held_icons()
/obj/item/Destroy()
if(ismob(loc))
@@ -95,8 +92,8 @@
//Checks if the item is being held by a mob, and if so, updates the held icons
/obj/item/proc/update_held_icon()
if(ismob(src.loc))
var/mob/M = src.loc
if(isliving(src.loc))
var/mob/living/M = src.loc
if(M.l_hand == src)
M.update_inv_l_hand()
else if(M.r_hand == src)
@@ -157,7 +154,7 @@
size = "huge"
return ..(user, distance, "", "It is a [size] item.")
/obj/item/attack_hand(mob/user as mob)
/obj/item/attack_hand(mob/living/user as mob)
if (!user) return
if (hasorgans(user))
var/mob/living/carbon/human/H = user
@@ -396,17 +393,15 @@ var/list/global/slot_flags_enumeration = list(
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
usr << "<span class='warning'>You can't pick things up!</span>"
return
var/mob/living/carbon/C = usr
if( usr.stat || usr.restrained() )//Is not asleep/dead and is not restrained
usr << "<span class='warning'>You can't pick things up!</span>"
return
if(src.anchored) //Object isn't anchored
usr << "<span class='warning'>You can't pick that up!</span>"
return
if(!usr.hand && usr.r_hand) //Right hand is not full
usr << "<span class='warning'>Your right hand is full.</span>"
return
if(usr.hand && usr.l_hand) //Left hand is not full
usr << "<span class='warning'>Your left hand is full.</span>"
if(C.get_active_hand()) //Hand is not full
usr << "<span class='warning'>Your hand is full.</span>"
return
if(!istype(src.loc, /turf)) //Object is on a turf
usr << "<span class='warning'>You can't pick that up!</span>"