mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 09:03:23 +01:00
Recoded wall-smoothing for optimization. Fixes #835.
Conflicts: code/game/smoothwall.dm code/game/turfs/simulated/walls.dm code/modules/power/singularity/singularity.dm
This commit is contained in:
@@ -76,6 +76,12 @@
|
||||
var/mineral = "metal"
|
||||
var/opening = 0
|
||||
|
||||
canSmoothWith = list(
|
||||
/turf/simulated/wall,
|
||||
/obj/structure/falsewall,
|
||||
/obj/structure/falserwall // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS.
|
||||
)
|
||||
|
||||
/obj/structure/falsewall/New()
|
||||
relativewall_neighbours()
|
||||
..()
|
||||
@@ -102,22 +108,8 @@
|
||||
icon_state = "[mineral]fwall_open"
|
||||
return
|
||||
|
||||
var/junction = 0 //will be used to determine from which side the wall is connected to other walls
|
||||
|
||||
for(var/turf/simulated/wall/W in orange(src,1))
|
||||
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
|
||||
if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
|
||||
junction |= get_dir(src,W)
|
||||
for(var/obj/structure/falsewall/W in orange(src,1))
|
||||
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
|
||||
if(src.mineral == W.mineral)
|
||||
junction |= get_dir(src,W)
|
||||
for(var/obj/structure/falserwall/W in orange(src,1))
|
||||
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
|
||||
if(src.mineral == W.mineral)
|
||||
junction |= get_dir(src,W)
|
||||
var/junction=findSmoothingNeighbors(check_minerals=1)
|
||||
icon_state = "[mineral][junction]"
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/falsewall/attack_hand(mob/user as mob)
|
||||
@@ -237,6 +229,11 @@
|
||||
anchored = 1
|
||||
var/mineral = "metal"
|
||||
var/opening = 0
|
||||
canSmoothWith = list(
|
||||
/turf/simulated/wall,
|
||||
/obj/structure/falsewall,
|
||||
/obj/structure/falserwall // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS.
|
||||
)
|
||||
|
||||
/obj/structure/falserwall/New()
|
||||
relativewall_neighbours()
|
||||
@@ -272,25 +269,8 @@
|
||||
if(!density)
|
||||
icon_state = "frwall_open"
|
||||
return
|
||||
|
||||
var/junction = 0 //will be used to determine from which side the wall is connected to other walls
|
||||
|
||||
for(var/turf/simulated/wall/W in orange(src,1))
|
||||
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
|
||||
if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
|
||||
junction |= get_dir(src,W)
|
||||
for(var/obj/structure/falsewall/W in orange(src,1))
|
||||
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
|
||||
if(src.mineral == W.mineral)
|
||||
junction |= get_dir(src,W)
|
||||
for(var/obj/structure/falserwall/W in orange(src,1))
|
||||
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
|
||||
if(src.mineral == W.mineral)
|
||||
junction |= get_dir(src,W)
|
||||
var/junction=findSmoothingNeighbors()
|
||||
icon_state = "rwall[junction]"
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/structure/falserwall/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(opening)
|
||||
|
||||
Reference in New Issue
Block a user