Skip to content

Commit c32c0c3

Browse files
Cleans up some ramp code.
1 parent 869e4f5 commit c32c0c3

File tree

6 files changed

+23
-39
lines changed

6 files changed

+23
-39
lines changed

code/game/base_turf.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
// Returns the open turf of a Z-stack by finding the nearest non-open turf below.
3636
/proc/get_open_turf_type(var/turf/T)
37-
if(!HasBelow(T.z))
37+
if(!istype(T) || !HasBelow(T.z))
3838
return
3939
var/turf/below = T
4040
while ((below = GetBelow(below)))

code/game/turfs/turf_ramps.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/turf/proc/handle_ramp_dug_below(turf/wall/natural/ramp)
22
if(simulated && !is_open())
3-
ChangeTurf(get_open_turf_type(z))
3+
ChangeTurf(get_open_turf_type(src))
44
return TRUE
55
return FALSE
66

code/game/turfs/walls/wall_icon.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
other_connections = dirs_to_corner_states(other_dirs)
113113

114114
/turf/wall/proc/update_wall_icon()
115+
115116
var/material_icon_base = get_wall_icon()
116117
var/base_color = get_base_color()
117118

code/game/turfs/walls/wall_natural_icon.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
var/turf/floor_data = floor_type
5353
new_icon = initial(floor_data.icon)
5454
new_icon_state = initial(floor_data.icon_state)
55-
new_color = initial(floor_data.color)
55+
new_color = base_color
5656

5757
var/turf/wall/natural/neighbor = get_step(src, turn(ramp_slope_direction, -90))
5858
var/has_left_neighbor = istype(neighbor) && neighbor.ramp_slope_direction == ramp_slope_direction
@@ -65,10 +65,10 @@
6565
state = "ramp-blend-left"
6666
else if(has_right_neighbor)
6767
state = "ramp-blend-right"
68-
var/image/I = image(material_icon_base, state, dir = ramp_slope_direction)
68+
var/image/I = image(icon = material_icon_base, icon_state = state, dir = ramp_slope_direction)
6969
add_overlay(I)
7070
if(shine)
71-
I = image(material_icon_base, "[state]-shine", dir = ramp_slope_direction)
71+
I = image(icon = material_icon_base, icon_state = "[state]-shine", dir = ramp_slope_direction)
7272
I.appearance_flags |= RESET_ALPHA
7373
I.alpha = shine
7474
add_overlay(I)

code/game/turfs/walls/wall_natural_ramps.dm

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,23 @@
44
QDEL_NULL_LIST(engravings)
55

66
var/old_ao = permit_ao
7-
if(ramp_slope_direction)
8-
9-
user?.visible_message(SPAN_NOTICE("\The [user] digs out \the [src], forming a ramp."))
10-
11-
drop_ore()
12-
permit_ao = FALSE
13-
blocks_air = FALSE
14-
density = FALSE
15-
opacity = FALSE
16-
17-
// Pretend to be a normal floor turf under the ramp.
18-
var/turf/under = floor_type
19-
icon = initial(under.icon)
20-
icon_state = initial(under.icon_state)
21-
color = initial(under.color)
22-
23-
decals = null
24-
var/turf/ramp_above = GetAbove(src)
25-
if(ramp_above)
26-
ramp_above.handle_ramp_dug_below(src)
27-
update_neighboring_ramps()
28-
29-
else
30-
7+
if(!ramp_slope_direction)
318
user?.visible_message(SPAN_NOTICE("\The [user] clears out \the [src]."))
32-
33-
permit_ao = initial(permit_ao)
34-
blocks_air = initial(blocks_air)
35-
density = initial(density)
36-
color = initial(color)
37-
refresh_opacity()
38-
39-
icon = 'icons/turf/walls/natural.dmi'
40-
icon_state = "blank"
9+
ChangeTurf(floor_type)
10+
return
11+
12+
user?.visible_message(SPAN_NOTICE("\The [user] digs out \the [src], forming a ramp."))
13+
drop_ore()
14+
permit_ao = FALSE
15+
blocks_air = FALSE
16+
density = FALSE
17+
opacity = FALSE
18+
decals = null
19+
var/turf/ramp_above = GetAbove(src)
20+
if(ramp_above)
21+
ramp_above.handle_ramp_dug_below(src)
22+
update_neighboring_ramps()
23+
update_icon()
4124

4225
if(!skip_icon_update)
4326
for(var/turf/wall/natural/neighbor in RANGE_TURFS(src, 1))

code/modules/materials/definitions/solids/materials_solid_stone.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/decl/material/solid/stone/Initialize()
3131
. = ..()
3232
texture = image('icons/turf/wall_texture.dmi', "concrete")
33-
texture.appearance_flags |= RESET_COLOR
33+
texture.appearance_flags |= RESET_COLOR | RESET_ALPHA
3434
texture.blend_mode = BLEND_MULTIPLY
3535

3636
/decl/material/solid/stone/get_wall_texture()

0 commit comments

Comments
 (0)