mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Fixes several wall issues.
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
/turf/simulated/wall/proc/set_material(var/material/newmaterial, var/material/newrmaterial)
|
||||
material = newmaterial
|
||||
reinf_material = newrmaterial
|
||||
update_material()
|
||||
check_relatives()
|
||||
check_relatives(1)
|
||||
|
||||
@@ -85,7 +86,10 @@
|
||||
else
|
||||
set_wall_state("[material.icon_base]fwall_open")
|
||||
|
||||
var/overlay = round(damage / material.integrity * damage_overlays.len) + 1
|
||||
var/dmg_amt = material.integrity
|
||||
if(reinf_material)
|
||||
dmg_amt += reinf_material.integrity
|
||||
var/overlay = round(damage / dmg_amt * damage_overlays.len) + 1
|
||||
if(overlay > damage_overlays.len)
|
||||
overlay = damage_overlays.len
|
||||
if(density)
|
||||
@@ -115,11 +119,11 @@
|
||||
var/turf/simulated/wall/T = get_step(src, checkdir)
|
||||
if(!istype(T) || !T.material)
|
||||
continue
|
||||
if(T.material && can_join_with(T))
|
||||
if(update_self)
|
||||
if(update_self)
|
||||
if(can_join_with(T))
|
||||
junction |= get_dir(src,T) //Not too sure why, but using checkdir just breaks walls.
|
||||
else
|
||||
T.check_relatives(1)
|
||||
else
|
||||
T.check_relatives(1)
|
||||
if(!isnull(junction))
|
||||
set_wall_state("[material.icon_base][junction]")
|
||||
return
|
||||
|
||||
@@ -144,15 +144,15 @@ var/list/global/wall_cache = list()
|
||||
|
||||
return ..()
|
||||
|
||||
/turf/simulated/wall/proc/dismantle_wall(devastated=0, explode=0)
|
||||
/turf/simulated/wall/proc/dismantle_wall(var/devastated, var/explode, var/no_product)
|
||||
|
||||
playsound(src, 'sound/items/Welder.ogg', 100, 1)
|
||||
if(reinf_material)
|
||||
reinf_material.place_dismantled_girder(src, reinf_material)
|
||||
reinf_material.place_dismantled_product(src,devastated)
|
||||
else
|
||||
material.place_dismantled_girder(src)
|
||||
material.place_dismantled_product(src,devastated)
|
||||
if(!no_product)
|
||||
if(reinf_material)
|
||||
reinf_material.place_dismantled_girder(src, reinf_material)
|
||||
else
|
||||
material.place_dismantled_girder(src)
|
||||
material.place_dismantled_product(src,devastated)
|
||||
|
||||
for(var/obj/O in src.contents) //Eject contents!
|
||||
if(istype(O,/obj/structure/sign/poster))
|
||||
@@ -161,6 +161,11 @@ var/list/global/wall_cache = list()
|
||||
else
|
||||
O.loc = src
|
||||
|
||||
clear_plants()
|
||||
material = name_to_material["placeholder"]
|
||||
reinf_material = null
|
||||
check_relatives()
|
||||
|
||||
ChangeTurf(/turf/simulated/floor/plating)
|
||||
|
||||
/turf/simulated/wall/ex_act(severity)
|
||||
@@ -275,6 +280,5 @@ var/list/global/wall_cache = list()
|
||||
..()
|
||||
|
||||
/turf/simulated/wall/Destroy()
|
||||
clear_plants()
|
||||
check_relatives()
|
||||
dismantle_wall(null,null,1)
|
||||
..()
|
||||
@@ -40,6 +40,9 @@ var/list/name_to_material
|
||||
if(!display_name)
|
||||
display_name = name
|
||||
|
||||
/material/placeholder
|
||||
name = "placeholder"
|
||||
|
||||
/material/proc/place_dismantled_girder(var/turf/target, var/material/reinf_material)
|
||||
var/obj/structure/girder/G = new(target)
|
||||
if(reinf_material)
|
||||
|
||||
Reference in New Issue
Block a user