Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes deconstructing walls causing runtimes #3398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions code/game/mecha/equipment/tools/mining_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@
/turf/closed/wall/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
while(drill.do_after_mecha(src, 15 / drill.drill_level))
drill.log_message("Drilled through [src]", LOG_MECHA)
alter_integrity(-drill.wall_decon_damage)
drill.occupant_message("<span class='notice'>You drill through some of the outer plating...</span>")
playsound(src,'sound/weapons/drill.ogg',60,TRUE)
if(!alter_integrity(-drill.wall_decon_damage))
return TRUE

/turf/closed/wall/r_wall/drill_act(obj/item/mecha_parts/mecha_equipment/drill/drill)
if(drill.drill_level >= DRILL_HARDENED)
while(drill.do_after_mecha(src, 20 / drill.drill_level))
drill.log_message("Drilled through [src]", LOG_MECHA)
alter_integrity(-drill.wall_decon_damage)
drill.occupant_message("<span class='notice'>You drill through some of the outer plating...</span>")
playsound(src,'sound/weapons/drill.ogg',60,TRUE)
if(!alter_integrity(-drill.wall_decon_damage))
return TRUE

else
drill.occupant_message("<span class='danger'>[src] is too durable to drill through.</span>")

Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,9 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb

/// Called when a mob tries to use the item as a tool.Handles most checks.
/obj/item/proc/use_tool(atom/target, mob/living/user, delay, amount=0, volume=0, datum/callback/extra_checks)
// we have no target, why are we even doing this?
if(isnull(target))
return
// No delay means there is no start message, and no reason to call tool_start_check before use_tool.
// Run the start check here so we wouldn't have to call it manually.
if(!delay && !tool_start_check(user, amount))
Expand Down
11 changes: 8 additions & 3 deletions code/game/turfs/closed/_closed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@
return ..()

/turf/closed/proc/attack_override(obj/item/W, mob/user, turf/loc)
if(!isclosedturf(src))
return
//the istype cascade has been spread among various procs for easy overriding or if we want to call something specific
if(try_decon(W, user, loc) || try_destroy(W, user, loc))
return
Expand All @@ -252,15 +254,18 @@
return TRUE

/turf/closed/proc/try_decon(obj/item/I, mob/user, turf/T)
var/act_duration = breakdown_duration
if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
return FALSE

to_chat(user, "<span class='notice'>You begin slicing through the outer plating...</span>")
while(I.use_tool(src, user, breakdown_duration, volume=50))
while(I.use_tool(src, user, act_duration, volume=50))
if(iswallturf(src))
to_chat(user, "<span class='notice'>You slice through some of the outer plating...</span>")
alter_integrity(-(I.wall_decon_damage),user,FALSE,TRUE)
if(!alter_integrity(-(I.wall_decon_damage),user,FALSE,TRUE))
return TRUE
else
break

return FALSE

Expand Down
8 changes: 6 additions & 2 deletions code/game/turfs/closed/minerals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,20 @@
return ..()

/turf/closed/mineral/try_decon(obj/item/I, mob/user, turf/T)
var/act_duration = breakdown_duration
if(I.tool_behaviour == TOOL_MINING)
if(!I.tool_start_check(user, amount=0))
return FALSE

to_chat(user, "<span class='notice'>You begin breaking through the rock...</span>")
while(I.use_tool(src, user, breakdown_duration, volume=50))
while(I.use_tool(src, user, act_duration, volume=50))
if(ismineralturf(src))
to_chat(user, "<span class='notice'>You break through some of the stone...</span>")
SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type)
alter_integrity(-(I.wall_decon_damage),user,FALSE,TRUE)
if(!alter_integrity(-(I.wall_decon_damage),user,FALSE,TRUE))
return TRUE
else
break

return FALSE

Expand Down
3 changes: 2 additions & 1 deletion code/game/turfs/closed/wall/reinf_walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
to_chat(user, "<span class='notice'>You begin slicing through the [src].</span>")
while(W.use_tool(src,user,30,volume = 100))
to_chat(user, "<span class='notice'>You slice through some of the outer plating...</span>")
alter_integrity(-(W.wall_decon_damage))
if(!alter_integrity(-(W.wall_decon_damage)))
return TRUE
return 1

switch(d_state)
Expand Down
18 changes: 3 additions & 15 deletions code/game/turfs/closed/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@
return null

/turf/closed/wall/attack_override(obj/item/W, mob/user, turf/loc)
if(try_clean(W, user, loc) || try_wallmount(W, user, loc))
if(!iswallturf(src))
return
if(try_clean(W, user, loc) || try_wallmount(W, user, loc) || try_decon(W, user, loc) || try_destroy(W, user, loc))
return
..()

/turf/closed/wall/proc/try_clean(obj/item/W, mob/user, turf/T)
if((user.a_intent != INTENT_HELP))
Expand Down Expand Up @@ -122,19 +123,6 @@

return FALSE

/turf/closed/wall/try_decon(obj/item/I, mob/user, turf/T)
if(I.tool_behaviour == TOOL_WELDER)
if(!I.tool_start_check(user, amount=0))
return FALSE

to_chat(user, "<span class='notice'>You begin slicing through the outer plating...</span>")
while(I.use_tool(src, user, breakdown_duration, volume=50))
if(iswallturf(src))
to_chat(user, "<span class='notice'>You slice through some of the outer plating...</span>")
alter_integrity(-(I.wall_decon_damage),FALSE,TRUE)

return FALSE

/turf/closed/wall/singularity_pull(S, current_size)
..()
wall_singularity_pull(current_size)
Expand Down
Loading