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

Too harmful to terrain/structures #50

Open
VanessaE opened this issue May 2, 2020 · 7 comments
Open

Too harmful to terrain/structures #50

VanessaE opened this issue May 2, 2020 · 7 comments

Comments

@VanessaE
Copy link

VanessaE commented May 2, 2020

I would like to suggest sharply reducing the damage a gun does to property/terrain if the target is protected e.g. by the areas mod. It's quite difficult to build nice looking structures if many things can be blown-away by a plain old shotgun.

[05-02 04:39] <cheapie> Perhaps only break nodes on a certain list if [they are] protected?

@ClobberXD
Copy link
Contributor

If you want to disable destruction of protected nodes, add the following to minetest.conf

shooter_enable_protection = true

shooter/shooter/api.lua

Lines 199 to 202 in cfb3818

shooter.punch_node = function(pos, spec)
if config.enable_protection and minetest.is_protected(pos, spec.user) then
return
end


If you want to disable node destruction entirely, then:

shooter_allow_nodes = false

@VanessaE
Copy link
Author

VanessaE commented May 2, 2020

Well, not disable, just reduce the damage

@ClobberXD
Copy link
Contributor

I understand. Thought I'd suggest some workarounds until that's implemented. :)

@VanessaE
Copy link
Author

VanessaE commented May 8, 2020

I went ahead and switched-on protection checking, shooter_enable_protection = true in the server's config and restarted it. The setting does not work.

Even an unprivileged user standing within a protected area owned by the admin (i.e. me) and shooting things within that protected zone can do damage. I refer to protection as done by areas mod. At least, for shotguns and rifles aimed at blocks made of wool (which I use for "carpeting").

@ClobberXD
Copy link
Contributor

Interesting...

Even an unprivileged user standing within a protected area owned by the admin (i.e. me) and shooting things within that protected zone can do damage. I refer to protection as done by areas mod.

Assuming the areas mod overrides minetest.is_protected, my guess is that the issue lies within shooter.

Here's the function that handles settings fetching:

shooter/shooter/api.lua

Lines 142 to 155 in cfb3818

shooter.get_configuration = function(conf)
for k, v in pairs(conf) do
local setting = minetest.settings:get("shooter_"..k)
if type(v) == "number" then
setting = tonumber(setting)
elseif type(v) == "boolean" then
setting = minetest.settings:get_bool("shooter_"..k)
end
if setting ~= nil then
conf[k] = setting
end
end
return conf
end

Could you please post a dump of conf here? This can be done by adding the following line before return conf:

print(dump(conf))

@VanessaE
Copy link
Author

VanessaE commented May 8, 2020

I can't do that right now since the server's running, but I think you wanted shooter.config anyway, which returns:

{
        admin_weapons = false,
        explosion_texture = "shooter_hit.png",
        allow_nodes = true,
        rounds_update_time = 0.4,
        allow_players = true,
        automatic_weapons = true,
        enable_protection = true,
        enable_blasting = false,
        damage_multiplier = 1,
        allow_entities = true,
        enable_particle_fx = true,
        enable_crafting = true,
        node_drops = false
}

(that's live, i.e. the server had been up and running for a bit; I got it via worldedit's //lua command)

@ClobberXD
Copy link
Contributor

That works too, I guess.

It indeed seems to be parsing the setting shooter_enable_protection correctly, which means that there's a problem in the mod itself. I'll see if I can spot something wrong in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants