diff --git a/settingtypes.txt b/settingtypes.txt index 7da5919..870d263 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -11,7 +11,6 @@ shooter_allow_nodes (Allow node destruction) bool true shooter_allow_entities (Allow damage to active objects in multiplayer mode) bool false shooter_allow_players (Allow damage to players in multiplayer mode) bool true shooter_rounds_update_time (Round update time, should be >= dedicated server step) float 0.4 -shooter_camera_height (Camera height used for raycasting) float 1.5 [shooter_crossbow] diff --git a/shooter/README.md b/shooter/README.md index d53c698..d9b208b 100644 --- a/shooter/README.md +++ b/shooter/README.md @@ -88,12 +88,6 @@ Maximum round 'step' processing interval, will inversely effect the long-range v `shooter_rounds_update_time = 0.4` -### Camera Height - -Player eye offset used for rayasting and particle effects - -`shooter_camera_height = 1.5` - API Documentation ----------------- diff --git a/shooter/api.lua b/shooter/api.lua index c8e3aee..cc883b0 100644 --- a/shooter/api.lua +++ b/shooter/api.lua @@ -34,7 +34,6 @@ shooter.config = { allow_entities = false, allow_players = true, rounds_update_time = 0.4, - camera_height = 1.5, } shooter.default_particles = { @@ -364,7 +363,7 @@ local function fire_weapon(player, itemstack, spec, extended) if not dir or not pos then return end - pos.y = pos.y + config.camera_height + pos.y = pos.y + player:get_properties().eye_height spec.origin = v3d.add(pos, dir) local interval = spec.tool_caps.full_punch_interval shots[spec.user] = minetest.get_us_time() / 1000000 + interval diff --git a/shooter_crossbow/init.lua b/shooter_crossbow/init.lua index f2c1a51..a0b3d34 100644 --- a/shooter_crossbow/init.lua +++ b/shooter_crossbow/init.lua @@ -225,7 +225,7 @@ for _, color in pairs(dye_basecolors) do local dir = user:get_look_dir() local yaw = user:get_look_horizontal() if pos and dir and yaw then - pos.y = pos.y + shooter.config.camera_height + pos.y = pos.y + user:get_properties().eye_height local obj = minetest.add_entity(pos, "shooter_crossbow:arrow_entity") local ent = nil diff --git a/shooter_grenade/init.lua b/shooter_grenade/init.lua index 222aea2..6d5a817 100644 --- a/shooter_grenade/init.lua +++ b/shooter_grenade/init.lua @@ -77,7 +77,7 @@ minetest.register_tool("shooter_grenade:grenade", { local dir = user:get_look_dir() local yaw = user:get_look_horizontal() if pos and dir then - pos.y = pos.y + shooter.config.camera_height + pos.y = pos.y + user:get_properties().eye_height local obj = minetest.add_entity(pos, "shooter_grenade:grenade_entity") if obj then minetest.sound_play("shooter_throw", {object=obj}) diff --git a/shooter_rocket/init.lua b/shooter_rocket/init.lua index cfba55e..bda2aa3 100644 --- a/shooter_rocket/init.lua +++ b/shooter_rocket/init.lua @@ -85,7 +85,7 @@ minetest.register_tool("shooter_rocket:rocket_gun_loaded", { local dir = user:get_look_dir() local yaw = user:get_look_horizontal() if pos and dir and yaw then - pos.y = pos.y + shooter.config.camera_height + pos.y = pos.y + user:get_properties().eye_height local obj = minetest.add_entity(pos, "shooter_rocket:rocket_entity") if obj then minetest.sound_play("shooter_rocket_fire", {object=obj})