vgstation-coders / vgstation13

Butts
GNU Affero General Public License v3.0
265 stars 544 forks source link

Fullmetal alchemist? #12571

Closed D3athrow-Issues closed 5 years ago

D3athrow-Issues commented 8 years ago

(WEB REPORT BY: reind REMOTE: 172.93.109.202:7777)

Revision (Should be above if you're viewing this from ingame!)

General description of the issue Coffins that build from 5 planks are deconstructed into 2 metal

What you expected to happen The coffin to be made back into wood planks

What actually happened I got 2 metal out of each coffin

Steps to reproduce if possible Make coffin for 5 wood Open coffin Apply welder ???? Profit

Shadowmech88 commented 8 years ago

Man, now I kind of want to code alchemy. But the sciencey kind, not the battle-magic kind.

jknpj commented 8 years ago

Aren't slimes alchemy mobs?

Zth-- commented 8 years ago

Easy fix

Intigracy commented 8 years ago

Well that name sure is a mouthful.

Probe1 commented 8 years ago

 >easy fix

Funny. I added w_type = RECYK_WOOD to coffin.dm . Didn't work. Decided to dig deeper. Realized there's a mountain of shitcode behind it.

Probe1 commented 8 years ago

Why the fuck is deconstructing objects handled in several different ways

Jesus christ this codebase has skeletons in it.

Zth-- commented 8 years ago

There should be a line that says new sheet/metal(loc). Replace it with wood and that's it. I said SHOULD

Probe1 commented 8 years ago

Yeah that's the rub. There should.

Probe1 commented 8 years ago

It inherits from this in [closets.dm]


/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
    if(src.opened)
        if(istype(W, /obj/item/weapon/grab))
            if(src.large)
                var/obj/item/weapon/grab/G = W
                src.MouseDrop_T(G.affecting, user)  //act like they were dragged onto the closet
            else
                to_chat(user, "<span class='notice'>The locker is too small to stuff [W] into!</span>")
        if(istype(W,/obj/item/tk_grab))
            return 0

        if(istype(W, /obj/item/weapon/weldingtool))
            var/obj/item/weapon/weldingtool/WT = W
            if(!WT.remove_fuel(0,user))
                to_chat(user, "<span class='notice'>You need more welding fuel to complete this task.</span>")
                return
            materials.makeSheets(src)
            for(var/mob/M in viewers(src))
                M.show_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WT].</span>", 1, "You hear welding.", 2)
            qdel(src)
            return

materials.makeSheets(src) Which is only used here


/datum/materials/proc/makeSheets(var/atom/loc)
    for (var/id in storage)
        var/amount = getAmount(id)
        if(amount)
            var/datum/material/mat = getMaterial(id)
            getFromPool(mat.sheettype, loc, Floor(amount / mat.cc_per_sheet))
Zth-- commented 8 years ago

Is the proc makeSheets used anywhere else? If that's the case you could make it so it takes another argument (type of sheet). If not, completely remove that shit. There are a lot of ways to address this, I'm not sure what other deconstructions do

Probe1 commented 8 years ago

Honestly this is the kinda thing that should be refactored to always use the same system. There's no need to have several different ways to skin a cat.

ComicIronic commented 8 years ago

completely remove a utility function from the materials system to fix a coffin bug

For what purpose

The real solution is to make it so that coffins have the wood material instead of the iron one.

Probe1 commented 8 years ago

If only someone would have wrote wood materials when they made material datums.

ComicIronic commented 8 years ago

Haha woops

Adding new materials isn't too difficult, and the system is deliberately extensible. Look at what's been done for cloth and leather in that PR, and it should fall out.

Probe1 commented 8 years ago

Will do.

ReindH commented 8 years ago

FYI the metal crates have the same issue. Costs 10 plasteel to make and becomes 2 metal sheets when deconstructed.

Probe1 commented 8 years ago

yea thats why I started getting uppity about the easy fix issue.

there is a vast sea of shit right below the surface of this issue. I regret looking under the waves of poo code and seeing the fathomless depths of shitcode. I stared into the shitbysss and it stared back into me.

okay its not that bad but it is a few hours job and a lot of testing.

PJB3005 commented 8 years ago

there is a vast sea of shit right below the surface of this issue. I regret looking under the waves of poo code and seeing the fathomless depths of shitcode. I stared into the shitbysss and it stared back into me.

Welcome to SS13, enjoy your stay!

Probe1 commented 7 years ago

"I will totally fix this for you Probe" says person soon to let Probe down.