Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit e3ea641

Browse files
committed
no more max_frame > frames_count;
added half-hack to anim move command condition;
1 parent 7b0d0e3 commit e3ea641

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/entity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ void Entity_DoAnimCommands(entity_p entity, struct ss_animation_s *ss_anim)
668668
switch(command->id)
669669
{
670670
case TR_ANIMCOMMAND_SETPOSITION:
671-
if(ss_anim->changing_next >= 0x02) // This command executes ONLY at the end of animation.
671+
if((ss_anim->onEndFrame == NULL) && (ss_anim->changing_next >= 0x02)) // This command executes ONLY at the end of animation.
672672
{
673673
float tr[3];
674674
entity->no_fix_all = 0x01;

src/resource.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ void TR_SkeletalModelInterpolateFrames(skeletal_model_p model, tr_animation_t *t
16251625
}
16261626

16271627
/*
1628-
* swap old and new animation bone brames
1628+
* swap old and new animation bone frames
16291629
* free old bone frames;
16301630
*/
16311631
for(uint16_t j = 0; j < anim->frames_count; j++)
@@ -1641,6 +1641,10 @@ void TR_SkeletalModelInterpolateFrames(skeletal_model_p model, tr_animation_t *t
16411641
anim->frames = new_bone_frames;
16421642
anim->frames_count = new_frames_count;
16431643
}
1644+
if(anim->max_frame > anim->frames_count)
1645+
{
1646+
anim->max_frame = anim->frames_count; // i.e.: unused animations
1647+
}
16441648
}
16451649
}
16461650

0 commit comments

Comments
 (0)