Re-adding object pooling for beam projectiles. Fixed the double damage bug with a spawn().

What was happening was returntopool was nulling the variable that prevented the projectile from bumping something twice, and for whatever reason despite having no loc the proj would bump the same mob twice then be in the void again. The spawn() allows the bump proc to finish and then the projectile is returned to the pool.
This commit is contained in:
d3athrow
2014-05-22 09:46:11 -05:00
parent cbcbdbe021
commit 7f4c0be941
10 changed files with 52 additions and 32 deletions

View File

@@ -114,7 +114,7 @@
A.fired()
*/
proc/Emit()
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter(src.loc)
var/obj/item/projectile/beam/emitter/A = getFromPool(/obj/item/projectile/beam/emitter, loc)
A.frequency = frequency
A.damage = mega_energy * 500
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)

View File

@@ -92,7 +92,7 @@
src.fire_delay = rand(20,100)
src.shot_number = 0
use_power(1000)
var/obj/item/projectile/beam/emitter/A = new /obj/item/projectile/beam/emitter(src.loc)
var/obj/item/projectile/beam/emitter/A = getFromPool(/obj/item/projectile/beam/emitter, loc)
playsound(get_turf(src), 'sound/weapons/emitter.ogg', 25, 1)
if(prob(35))
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread