stujones11 / shooter

First Person Shooter Mod for Minetest
Other
30 stars 18 forks source link

Too harmful to terrain/structures #50

Open VanessaE opened 4 years ago

VanessaE commented 4 years ago

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 commented 4 years ago

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

shooter_enable_protection = true

https://github.com/stujones11/shooter/blob/cfb3818b09cc013c8aa84c4baa1253e90d8e6384/shooter/api.lua#L199-L202


If you want to disable node destruction entirely, then:

shooter_allow_nodes = false
VanessaE commented 4 years ago

Well, not disable, just reduce the damage

ClobberXD commented 4 years ago

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

VanessaE commented 4 years ago

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 commented 4 years ago

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:

https://github.com/stujones11/shooter/blob/cfb3818b09cc013c8aa84c4baa1253e90d8e6384/shooter/api.lua#L142-L155

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 commented 4 years ago

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 commented 4 years ago

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.