mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Quicker explosions:
- This is more of a fix for the current method of explosions, not a fix to make explosions more efficient as a whole. - Explosions used circlerange() which had improperly named vars. At a glance, it looked like it was just returning turfs in range, but in reality it was returning all atoms in range. - Explosions now use circlerangeturfs() which only returns turfs circlerange() - Changed the variable names to reflect what they actually use to prevent this kind of confusion again. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3832 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -51,17 +51,17 @@
|
||||
/proc/circleview(center=usr,radius=3)
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/turfs = new/list()
|
||||
var/list/atoms = new/list()
|
||||
var/rsq = radius * (radius+0.5)
|
||||
|
||||
for(var/atom/T in view(radius, centerturf))
|
||||
var/dx = T.x - centerturf.x
|
||||
var/dy = T.y - centerturf.y
|
||||
for(var/atom/A in view(radius, centerturf))
|
||||
var/dx = A.x - centerturf.x
|
||||
var/dy = A.y - centerturf.y
|
||||
if(dx*dx + dy*dy <= rsq)
|
||||
turfs += T
|
||||
atoms += A
|
||||
|
||||
//turfs += centerturf
|
||||
return turfs
|
||||
return atoms
|
||||
|
||||
/proc/get_dist_euclidian(atom/Loc1 as turf|mob|obj,atom/Loc2 as turf|mob|obj)
|
||||
var/dx = Loc1.x - Loc2.x
|
||||
@@ -84,7 +84,7 @@
|
||||
turfs += T
|
||||
return turfs
|
||||
|
||||
/proc/circleviewturfs(center=usr,radius=3)
|
||||
/proc/circleviewturfs(center=usr,radius=3) //Is there even a diffrence between this proc and circlerangeturfs()?
|
||||
|
||||
var/turf/centerturf = get_turf(center)
|
||||
var/list/turfs = new/list()
|
||||
|
||||
@@ -26,10 +26,10 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
var/list/fTurfs = list() //Holds turfs to loop through for mobs to flash. (Hehehe, dirty)
|
||||
|
||||
if(roundExplosions)
|
||||
fTurfs = circlerange(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range))
|
||||
dTurfs = circlerange(epicenter,devastation_range)
|
||||
hTurfs = circlerange(epicenter,heavy_impact_range) - dTurfs
|
||||
lTurfs = circlerange(epicenter,light_impact_range) - dTurfs - hTurfs
|
||||
fTurfs = circlerangeturfs(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range))
|
||||
dTurfs = circlerangeturfs(epicenter,devastation_range)
|
||||
hTurfs = circlerangeturfs(epicenter,heavy_impact_range) - dTurfs
|
||||
lTurfs = circlerangeturfs(epicenter,light_impact_range) - dTurfs - hTurfs
|
||||
else
|
||||
fTurfs = range(epicenter,max(devastation_range, heavy_impact_range, light_impact_range, flash_range))
|
||||
dTurfs = range(epicenter,devastation_range)
|
||||
|
||||
Reference in New Issue
Block a user