Logic for overriding fall landing and landframes.
@@ -20217,6 +20217,13 @@ bool check_landframe(entity *ent)
{
return 0;
}
+
+ // Can't be bound with a landframe override.
+ if(check_bind_override(ent, BINDING_OVERRIDING_LANDFRAME))
+ {
+ return 0;
+ }
+
// Can't be passed over current animation's frame count.
if(ent->animation->landframe->frame > ent->animation->numframes)
{
@@ -20422,7 +20429,13 @@ void check_gravity(entity *e)
// UTunnels: tossv <= 0 means land, while >0 means still rising, so
// you wont be stopped if you are passing the edge of a wall
- if( (self->position.y <= self->base || !inair(self)) && self->velocity.y <= 0 )
+ if( self->position.y <= self->base || !inair(self))
+ {
+ // 0+ means still rising. We need to be falling.
+ if(self->velocity.y <=0)
+ {
+ // No bind target, or binding set to ignore fall lands.
+ if(!check_bind_override(self, BINDING_OVERRIDING_FALL_LAND))
{
self->position.y = self->base;
self->falling = 0;
@@ -20492,6 +20505,8 @@ void check_gravity(entity *e)
// in case landing, set hithead to NULL
self->hithead = NULL;
+ }
+ }
}// end of if - land checking
}// end of if - in-air checking
if(self->toss_time <= _time)
@@ -21625,6 +21640,23 @@ void adjust_bind(entity *e)
#undef ADJUST_BIND_NO_FRAME_MATCH
}
+// Caskey, Damon V.
+// 2018-09-08
+//
+// Return true if the target entity has a valid
+// bind target and match for the override argument.
+int check_bind_override(entity *ent, e_binding_overriding overriding)
+{
+ if(ent->binding.ent)
+ {
+ if(ent->binding.overriding & overriding)
+ {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
void check_move(entity *e)
{
