Fixes inconsistant material refunds and removes material cost from door repair (#15511)

* Oops did two different things at once

Started out with me fixing improper material refunds on deconstructs, ended with me making doors not cost materials. Oops!

* Graaah code fixius

I know how new works now

* Huge fart on PR

I am so good at code
huge fartius

epic /obj fail

I forgor

* More effort than it's worth.

unless im being lied to...!
This commit is contained in:
Reo Lozzot
2024-04-11 18:10:04 +10:00
committed by GitHub
parent 4c90f3953d
commit d39d966206
11 changed files with 50 additions and 82 deletions
+7 -6
View File
@@ -64,10 +64,10 @@
/obj/structure/catwalk/ex_act(severity)
switch(severity)
if(1)
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc, 2) //VOREstation Edit: Conservation of mass
qdel(src)
if(2)
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc, 2) //VOREstation Edit: Conservation of mass
qdel(src)
/obj/structure/catwalk/attack_robot(var/mob/user)
@@ -77,11 +77,12 @@
/obj/structure/catwalk/proc/deconstruct(mob/user)
playsound(src, 'sound/items/Welder.ogg', 100, 1)
to_chat(user, "<span class='notice'>Slicing \the [src] joints ...</span>")
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc)
//Lattice would delete itself, but let's save ourselves a new obj
if(isspace(loc) || isopenspace(loc))
if(isopenspace(loc) && user.a_intent == I_HELP)
new /obj/structure/lattice/(src.loc)
new /obj/item/stack/rods(src.loc, 1)
else
new /obj/item/stack/rods(src.loc, 2)
if(plated_tile)
new plated_tile(src.loc)
qdel(src)
@@ -200,4 +201,4 @@
/obj/effect/catwalk_plated/techfloor
icon_state = "catwalk_techfloor"
tile = /obj/item/stack/tile/floor/techgrey
platecolor = "#363f43"
platecolor = "#363f43"
+1 -1
View File
@@ -291,7 +291,7 @@
reinforcing = 0
/obj/structure/girder/proc/dismantle()
girder_material.place_dismantled_product(get_turf(src))
girder_material.place_dismantled_product(get_turf(src), 2) //VOREstation Edit: Conservation of mass
qdel(src)
/obj/structure/girder/attack_hand(mob/user as mob)
+12 -12
View File
@@ -64,20 +64,12 @@
if(WT.welding == 1)
if(WT.remove_fuel(0, user))
to_chat(user, "<span class='notice'>Slicing lattice joints ...</span>")
new /obj/item/stack/rods(src.loc)
new /obj/item/stack/rods(src.loc, 1) //VOREstation Edit: Return the same amount of rods used to build this.
qdel(src)
return
if(istype(C, /obj/item/stack/rods))
var/obj/item/stack/rods/R = C
if(R.get_amount() < 2)
to_chat(user, "<span class='notice'>You need at least two rods to form a catwalk here.</span>")
else
to_chat(user, "<span class='notice'>You start connecting \the [R.name] to \the [src.name] ...</span>")
if(do_after(user, 5 SECONDS))
R.use(2) //2023-02-27 bugfix to prevent rods being used without catwalk creation
src.alpha = 0 // Note: I don't know why this is set, Eris did it, just trusting for now. ~Leshana
new /obj/structure/catwalk(src.loc)
qdel(src)
if(istype(C, /obj/item/stack/rods)) //VOREstation Edit: Modernizes upgrading lattices into catwalks.
upgrade(C, user)
//VOREstation Edit End
return
return
@@ -98,3 +90,11 @@
icon_state = "lattice[dir_sum]"
return
//Vorestation Edit: Moves upgrading lattices to their own proc for other stuff to call. Also makes them instant.
/obj/structure/lattice/proc/upgrade(obj/item/stack/rods/R, mob/user)
to_chat(user, "<span class='notice'>You start connecting \the [R.name] to \the [src.name] ...</span>")
R.use(1)
src.alpha = 0 // Note: I don't know why this is set, Eris did it, just trusting for now. ~Leshana
new /obj/structure/catwalk(src.loc)
qdel(src)