mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Adds caching to dummy objects, seems to work great.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user