From a93bb59536485fd552ac4bd2a40fdc3d5d736d7d Mon Sep 17 00:00:00 2001 From: Lars Date: Sun, 1 May 2022 16:08:50 -0700 Subject: [PATCH] Optional disable empty shell animation. --- init.lua | 5 +++-- settingtypes.txt | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 85d0d85..6996082 100644 --- a/init.lua +++ b/init.lua @@ -670,7 +670,7 @@ rangedweapons_launch_projectile = function(player,projNum,projDmg,projEnt,visual minetest.sound_play(shoot_sound, {pos = pos, max_hear_distance = 500}) pos.y = pos.y + 1.45 - if has_shell > 0 then + if has_shell > 0 and minetest.settings:get_bool("rangedweapons_animate_empty_shells", true) then local shl = minetest.add_entity(pos, shellEnt) shl:set_velocity({x=dir.x * -10, y=dir.y * -10, z=dir.z * -10}) shl:set_acceleration({x=dir.x * -5, y= -10, z=dir.z * -5}) @@ -678,7 +678,8 @@ shl:set_rotation({x=0,y=yaw - math.pi/2,z=-svertical}) shl:set_properties({ textures = {shellTexture}, visual = shellVisual,}) - end + end + if smokeSize > 0 then minetest.add_particle({ pos = pos, diff --git a/settingtypes.txt b/settingtypes.txt index 6f3df77..b490a8b 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -37,6 +37,9 @@ rangedweapons_min_gun_efficiency (Minimum Gun Skill) int 40 # Use particles on bullet impact (disabling can improve server lag) rangedweapons_impact_particles (Particles on impact) bool true +# Animate Empty Shells ascEntities (disabling can improve server lag) +rangedweapons_animate_empty_shells (Animate Empty Shells) bool true + rangedweapons_shurikens (Enable Shurikens) bool true rangedweapons_handguns (Enable Handgus) bool true