minetest-mods / castle_gates

Large swinging and sliding gate components suitable for a castle
MIT License
9 stars 8 forks source link

Redundant code? #4

Closed enkidu-smith closed 7 years ago

enkidu-smith commented 7 years ago

I was having an issue with arrow_slits in castle_masonry, but looking at the code led me to this sub project. It seemed to me that the section of code for portcullis was not needed (or referenced anywhere else AFAICT) and was causing the issues. I commented it out and the arrow slits stuff started working (see https://github.com/minetest-mods/castle_masonry/issues/5). I'm not confident enough to create a patch/pull request.

Commented out code in castle/castle_gates/gate_slots.lua is as follows

    -- minetest.register_craft({
    -- output = mod_name..":"..material.name.."_portcullis_slot 3",
    -- recipe = {
    --      {material.craft_material,"",material.craft_material},
    --      {material.craft_material,"",material.craft_material},
    --      {material.craft_material,"",material.craft_material},
    --      },
    -- })

    -- minetest.register_craft({
    --      output = mod_name..":"..material.name.."_portcullis_slot",
    --      type = "shapeless",
    --      recipe = {mod_name..":"..material.name.."_portcullis_slot_reverse"},
    -- })
    -- minetest.register_craft({
    --      output = mod_name..":"..material.name.."_portcullis_slot_reverse",
    --      type = "shapeless",
    --      recipe = {mod_name..":"..material.name.."_portcullis_slot"},
    -- })

    -- if burn_time > 0 then
    --      minetest.register_craft({
    --              type = "fuel",
    --              recipe = mod_name..":"..material.name.."_portcullis_slot",
    --              burntime = burn_time * 2,
    --      })
    --      minetest.register_craft({
    --              type = "fuel",
    --              recipe = mod_name..":"..material.name.."_portcullis_slot_reverse",
    --              burntime = burn_time * 2,
    --      })
    -- end
ghost commented 7 years ago

Same issue: arrowslits crafting creates an unknown node and the console logs this:
ACTION[Server]: player singleplayer crafts castle_gates:stone_portcullis_slot 3

FaceDeer commented 7 years ago

Embarrassing bug on my part, sorry. The recipe should have been for crafting gate_slot nodes rather than portcullis_slot nodes. I've fixed it, and changed the recipe to avoid collision.