Skip to content

Commit

Permalink
Merge pull request #88 from whitedragon0000/PLUS
Browse files Browse the repository at this point in the history
improved code for fix range y and quake
  • Loading branch information
whitedragon0000 authored Jul 26, 2020
2 parents 20e36a5 + 0fbae52 commit eb9b4dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions engine/openbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -10426,7 +10426,7 @@ s_model *load_cached_model(char *name, char *owner, char unload)
newanim->subentity = newanim->projectile.bomb = newanim->projectile.knife =
newanim->projectile.star = newanim->projectile.boomerang =
newanim->projectile.flash = -1;
newanim->quakeframe.framestart = 0;
newanim->quakeframe.framestart = -1;
newanim->sync = -1;

if((ani_id = translate_ani_id(value, newchar, newanim, attack)) < 0)
Expand Down Expand Up @@ -16693,8 +16693,8 @@ void draw_visual_debug()
// function's min Y parameter, and and min Y into function's
// max Y parameter).

range_y_min = -entity->animation->range.y.min;
range_y_max = -entity->animation->range.y.max;
range_y_min = -1 * (entity->animation->range.y.min + T_MIN_BASEMAP);
range_y_max = -1 * entity->animation->range.y.max;

draw_box_on_entity(entity, entity->animation->range.x.min, range_y_max, entity->position.z+1, entity->animation->range.x.max, range_y_min, -1, LOCAL_COLOR_GREEN, &drawmethod);
}
Expand Down Expand Up @@ -18145,15 +18145,15 @@ void update_frame(entity *ent, unsigned int f)
}
}

if(anim->quakeframe.framestart + anim->quakeframe.cnt == f)
if(anim->quakeframe.framestart >= 0 && (anim->quakeframe.framestart + anim->quakeframe.cnt == f))
{
if(level)
{
if(anim->quakeframe.cnt % 2 || anim->quakeframe.v > 0)
{
level->quake = anim->quakeframe.v;
}
else if (anim->quakeframe.repeat > 0)
else
{
level->quake = anim->quakeframe.v * -1;
}
Expand Down

0 comments on commit eb9b4dc

Please sign in to comment.