mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 12:01:06 +01:00
Added reset for player respawning to remove FOV modifiers.
Fixed missing on_end call in remove_all_modifiers. Added mcl_fovapi to Bows, Sprint, and Spyglass.
This commit is contained in:
parent
bf41e116a1
commit
6cfb55e853
4 changed files with 12 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
name = mcl_bows
|
||||
author = Arcelmi
|
||||
description = This mod adds bows and arrows for MineClone 2.
|
||||
depends = controls, mcl_particles, mcl_enchanting, mcl_init, mcl_util, mcl_shields
|
||||
depends = controls, mcl_particles, mcl_enchanting, mcl_init, mcl_util, mcl_shields, mcl_fovapi
|
||||
optional_depends = awards, mcl_achievements, mcl_core, mcl_mobitems, playerphysics, doc, doc_identifier, mesecons_button
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
name = mcl_spyglass
|
||||
author = NO11
|
||||
description = This mod adds a spyglass, which is an item that can be used for zooming in on specific locations.
|
||||
depends = mcl_core, controls
|
||||
depends = mcl_core, controls, mcl_fovapi
|
||||
|
|
|
@ -60,6 +60,10 @@ function mcl_fovapi.register_modifier(name, fov_factor, time, is_multiplier, exc
|
|||
|
||||
end
|
||||
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
mcl_fovapi.remove_all_modifiers(player:get_player_name())
|
||||
end)
|
||||
|
||||
function mcl_fovapi.apply_modifier(player, modifier_name)
|
||||
if player == nil then
|
||||
return
|
||||
|
@ -162,6 +166,9 @@ function mcl_fovapi.remove_all_modifiers(player)
|
|||
end
|
||||
|
||||
player:set_fov(0, false, 0)
|
||||
if mcl_fovapi.registered_modifiers[modifier_name].on_end ~= nil then
|
||||
mcl_fovapi.registered_modifiers[modifier_name].on_end(player)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
name = mcl_sprint
|
||||
author = GunshipPenguin
|
||||
description = Allows the player to sprint by pressing the “Use” key (default: E).
|
||||
depends = mcl_playerinfo, playerphysics, mcl_hunger
|
||||
description = Allows the player to sprint by pressing the “AUX” key (default: E).
|
||||
depends = mcl_playerinfo, playerphysics, mcl_hunger, mcl_fovapi
|
||||
optional = mcl_bows
|
Loading…
Reference in a new issue