Adds caching to dummy objects, seems to work great.

This commit is contained in:
SkyMarshal
2012-07-26 17:14:31 -07:00
parent 54ce48fb9d
commit 62dcb7be1b
4 changed files with 43 additions and 30 deletions
@@ -700,10 +700,15 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
health = 150
stat = 0
/mob/living/carbon/metroid/proc/get_obstacle_ok(atom/A)
var/direct = get_dir(src, A)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( src.loc )
var/obj/item/weapon/dummy/D = locate() in DummyCache //See atom_procs.dm
if(!D)
D = new /obj/item/weapon/dummy( src.loc )
else
D.loc = src.loc
DummyCache.Remove(D)
var/ok = 0
if ( (direct - 1) & direct)
@@ -781,7 +786,8 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
del(D)
D.loc = null
DummyCache.Add(D)
if (!( ok ))
return 0
-16
View File
@@ -502,22 +502,6 @@
H.vent_gas(loc)
del(H)
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover,/obj/item) && mover.throwing)
var/obj/item/I = mover
if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile))
return
if(prob(75))
I.loc = src
for(var/mob/M in viewers(src))
M.show_message("\the [I] lands in \the [src].", 3)
else
for(var/mob/M in viewers(src))
M.show_message("\the [I] bounces off of \the [src]'s rim!", 3)
return 0
else
return ..()
// virtual disposal object
// travels through pipes in lieu of actual items
// contents will be items flushed by the disposal