diff --git a/mods/ITEMS/mcl_armor/armor.lua b/mods/ITEMS/mcl_armor/armor.lua index 690b8b03cf..359282a877 100644 --- a/mods/ITEMS/mcl_armor/armor.lua +++ b/mods/ITEMS/mcl_armor/armor.lua @@ -363,6 +363,8 @@ mcl_player.player_register_model("mcl_armor_character.b3d", { swim_walk_mine = {x=389, y=408}, swim_stand = {x=434, y=434}, swim_mine = {x=411, y=430}, + run_walk = {x=440, y=459}, + run_walk_mine = {x=461, y=480}, }, }) diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d index ae21932d5a..2f9426fc32 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.b3d differ diff --git a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend index 69df743146..97b1bf08b3 100644 Binary files a/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend and b/mods/ITEMS/mcl_armor/models/mcl_armor_character.blend differ diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 730a9c0b17..a94e3dfe17 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -31,6 +31,8 @@ mcl_player.player_register_model("character.b3d", { sneak_mine = {x=346, y=366}, sneak_walk = {x=304, y=323}, sneak_walk_mine = {x=325, y=344}, + run_walk = {x=440, y=460}, + run_walk_mine = {x=461, y=481}, }, }) @@ -158,8 +160,8 @@ minetest.register_globalstep(function(dtime) local node_in_feet = minetest.registered_nodes[mcl_playerinfo[name].node_feet] -- ask if player is swiming local standing_on_water = minetest.get_item_group(mcl_playerinfo[name].node_feet, "water") ~= 0 - - + -- ask if player is sprinting + local is_sprinting = mcl_sprint.is_sprinting(name) -- Apply animations based on what the player is doing if player:get_hp() == 0 then @@ -169,28 +171,32 @@ minetest.register_globalstep(function(dtime) player_anim[name] = nil player_sneak[name] = controls.sneak end - if controls.LMB and not controls.sneak and standing_on_water then + if controls.LMB and not controls.sneak and standing_on_water and is_sprinting == true then player_set_animation(player, "swim_walk_mine", animation_speed_mod) - elseif not controls.sneak and standing_on_water then + elseif not controls.sneak and standing_on_water and is_sprinting == true then player_set_animation(player, "swim_walk", animation_speed_mod) - elseif controls.LMB and not controls.sneak and not standing_on_water then + elseif is_sprinting == true and controls.LMB and not controls.sneak and not standing_on_water then + player_set_animation(player, "run_walk_mine", animation_speed_mod) + elseif controls.LMB and not controls.sneak then player_set_animation(player, "walk_mine", animation_speed_mod) - elseif controls.LMB and controls.sneak and not standing_on_water then + elseif controls.LMB and controls.sneak and is_sprinting ~= true then player_set_animation(player, "sneak_walk_mine", animation_speed_mod) - elseif not controls.sneak and not standing_on_water then - player_set_animation(player, "walk", animation_speed_mod) - else + elseif is_sprinting == true and not controls.sneak and not standing_on_water then + player_set_animation(player, "run_walk", animation_speed_mod) + elseif controls.sneak and not controls.LMB then player_set_animation(player, "sneak_walk", animation_speed_mod) + else + player_set_animation(player, "walk", animation_speed_mod) end - elseif controls.LMB and not controls.sneak and standing_on_water then + elseif controls.LMB and not controls.sneak and standing_on_water and is_sprinting == true then player_set_animation(player, "swim_mine") - elseif controls.LMB and not controls.sneak and not standing_on_water then + elseif controls.LMB and not controls.sneak then player_set_animation(player, "mine") elseif controls.LMB and controls.sneak then player_set_animation(player, "sneak_mine") - elseif not controls.sneak and standing_on_water then + elseif not controls.sneak and standing_on_water and is_sprinting == true then player_set_animation(player, "swim_stand", animation_speed_mod) - elseif not controls.sneak and not standing_on_water then + elseif not controls.sneak then player_set_animation(player, "stand", animation_speed_mod) else player_set_animation(player, "sneak_stand", animation_speed_mod) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 34291c8f2f..dec3771da7 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -44,7 +44,7 @@ minetest.register_globalstep(function(dtime) -- sets eye height, and nametag color accordingly player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }}) - elseif minetest.get_item_group(mcl_playerinfo[name].node_feet, "water") ~= 0 and player:get_attach() == nil then + elseif minetest.get_item_group(mcl_playerinfo[name].node_feet, "water") ~= 0 and player:get_attach() == nil and mcl_sprint.is_sprinting(name) == true then -- controls head pitch when swiming player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90,0,0)) -- sets eye height, and nametag color accordingly