Apply binding animation flag constants. Also adds experimental option to kill when frame match is unavailable.
@@ -21307,13 +21307,15 @@ void adjust_bind(entity *e)
{
if(e->binding.ent)
{
+
if(e->binding.ani_bind)
{
if(e->animnum != e->binding.ent->animnum)
{
if(!validanim(e, e->binding.ent->animnum))
{
- if(e->binding.ani_bind & 4)
+ // Don't have the animation? Kill ourself.
+ if(e->binding.ani_bind & BINDING_ANI_ANIMATION_KILL)
{
kill_entity(e);
}
@@ -21322,11 +21324,25 @@ void adjust_bind(entity *e)
}
ent_set_anim(e, e->binding.ent->animnum, 1);
}
- if(e->animpos != e->binding.ent->animpos && e->binding.ani_bind & 2)
+
+ if(e->animpos != e->binding.ent->animpos && e->binding.ani_bind & BINDING_ANI_FRAME_MATCH)
+ {
+ // If we don't have the frame and frame kill flag is set, kill ourself.
+ if(e->animation[e->animnum].numframes < e->binding.ent->animation[e->binding.ent->animnum].numframes)
{
+ if(e->binding.ani_bind & BINDING_ANI_FRAME_KILL)
+ {
+ kill_entity(e);
+ e->binding.ent = NULL;
+ return;
+ }
+ }
+
update_frame(e, e->binding.ent->animpos);
}
}
+
+
if (e->binding.enable.z) e->position.z = e->binding.ent->position.z + e->binding.offset.z;
if (e->binding.enable.y) e->position.y = e->binding.ent->position.y + e->binding.offset.y;
e->sortid = e->binding.ent->sortid + e->binding.sortid;
