Mob size tweaks.

Merges the use of the is_small and mob_size into one.
Changes the species size handling to set the mob size instead of being yet another separate var to check.
This commit is contained in:
PsiOmegaDelta
2015-09-20 17:12:07 +02:00
parent 292c1545cb
commit d891fba1cc
33 changed files with 57 additions and 62 deletions
@@ -11,7 +11,7 @@
var/wall_mounted = 0 //never solid (You can always pass over it)
var/health = 100
var/breakout = 0 //if someone is currently breaking out. mutex
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate
var/storage_capacity = 2 * MOB_MEDIUM //This is so that someone can't pack hundreds of items in a locker/crate
//then open it in a populated area to crash clients.
var/open_sound = 'sound/machines/click.ogg'
var/close_sound = 'sound/machines/click.ogg'
@@ -20,8 +20,6 @@
var/store_items = 1
var/store_mobs = 1
var/const/default_mob_size = 15
/obj/structure/closet/initialize()
if(!opened) // if closed, any item at the crate's loc is put in the contents
var/obj/item/I
@@ -145,14 +143,13 @@
for(var/mob/living/M in src.loc)
if(M.buckled || M.pinned.len)
continue
var/current_mob_size = (M.mob_size ? M.mob_size : default_mob_size)
if(stored_units + added_units + current_mob_size > storage_capacity)
if(stored_units + added_units + M.mob_size > storage_capacity)
break
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.forceMove(src)
added_units += current_mob_size
added_units += M.mob_size
return added_units
/obj/structure/closet/proc/toggle(mob/user as mob)
@@ -32,7 +32,7 @@
if(istype(victim, /mob/living/carbon/human))
var/mob/living/carbon/human/H = victim
if(!H.species.is_small)
if(!issmall(H))
return 0
meat_type = H.species.meat_type
icon_state = "spikebloody"