mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-28 02:52:01 +00:00
Projectiles will no longer lag the server to death (#7960)
About 1.1 million instances of this runtime. This fixes all of them. In a somewhat sane manner. There was currently no mechanic which made projectiles stop if they reached the end of the map. This makes them qdel themselves.
This commit is contained in:
@@ -362,6 +362,10 @@
|
||||
on_impact(loc)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if (QDELETED(src))
|
||||
return
|
||||
|
||||
last_projectile_move = world.time
|
||||
if(!nondirectional_sprite && !hitscanning)
|
||||
var/matrix/M = new
|
||||
@@ -369,6 +373,11 @@
|
||||
transform = M
|
||||
trajectory.increment(trajectory_multiplier)
|
||||
var/turf/T = trajectory.return_turf()
|
||||
|
||||
if (!T) // Nowhere to go. Just die.
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(T.z != loc.z)
|
||||
before_move()
|
||||
before_z_change(loc, T)
|
||||
@@ -513,7 +522,8 @@
|
||||
required_moves = SSprojectiles.global_max_tick_moves
|
||||
if(!required_moves)
|
||||
return
|
||||
for(var/i in 1 to required_moves)
|
||||
|
||||
for(var/i = 1; i <= required_moves && !QDELETED(src); i++)
|
||||
pixel_move(required_moves)
|
||||
|
||||
/obj/item/projectile/proc/setAngle(new_angle) //wrapper for overrides.
|
||||
|
||||
Reference in New Issue
Block a user