Fix the death animation looping while the player is dead, by using a still frame instead (I don't believe the amount of detail for a full animation is needed anyway). Also call the animation Lay instead of Death, so other mods like beds can use it

This commit is contained in:
MirceaKitsune 2012-11-27 02:50:19 +02:00
parent 89fb5aed7f
commit e7b4b2ba57
3 changed files with 769 additions and 1130 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -24,14 +24,14 @@ function player_get_animations(model)
stand_END = 79, stand_END = 79,
sit_START = 81, sit_START = 81,
sit_END = 160, sit_END = 160,
walk_START = 162, lay_START = 162,
walk_END = 181, lay_END = 166,
mine_START = 183, walk_START = 168,
mine_END = 192, walk_END = 187,
walk_mine_START = 194, mine_START = 189,
walk_mine_END = 213, mine_END = 198,
death_START = 215, walk_mine_START = 200,
death_END = 234 walk_mine_END = 219
} }
end end
end end
@ -46,10 +46,10 @@ local player_anim = {}
local player_sneak = {} local player_sneak = {}
local ANIM_STAND = 1 local ANIM_STAND = 1
local ANIM_SIT = 2 local ANIM_SIT = 2
local ANIM_WALK = 3 local ANIM_LAY = 3
local ANIM_WALK_MINE = 4 local ANIM_WALK = 4
local ANIM_MINE = 5 local ANIM_WALK_MINE = 5
local ANIM_DEATH = 6 local ANIM_MINE = 6
-- Called when a player's appearance needs to be updated -- Called when a player's appearance needs to be updated
function player_update_visuals(pl) function player_update_visuals(pl)
@ -102,10 +102,9 @@ function player_step(dtime)
-- Apply animations based on what the player is doing -- Apply animations based on what the player is doing
if pl:get_hp() == 0 then if pl:get_hp() == 0 then
if player_anim[name] ~= ANIM_DEATH then if player_anim[name] ~= ANIM_LAY then
-- TODO: The death animation currently loops, we must make it play only once then stay at the last frame somehow pl:set_animation({x=anim.lay_START, y=anim.lay_END}, animation_speed_mod, animation_blend)
pl:set_animation({x=anim.death_START, y=anim.death_END}, animation_speed_mod, animation_blend) player_anim[name] = ANIM_LAY
player_anim[name] = ANIM_DEATH
end end
elseif walking and controls.LMB then elseif walking and controls.LMB then
if player_anim[name] ~= ANIM_WALK_MINE then if player_anim[name] ~= ANIM_WALK_MINE then