Fix unable to bash box on the side underwater
parent
2de6eaa107
commit
a123e59c82
|
@ -25,7 +25,7 @@
|
||||||
#ifndef TILE16_SIZE
|
#ifndef TILE16_SIZE
|
||||||
#define PLAYER_WIDTH 22
|
#define PLAYER_WIDTH 22
|
||||||
#define PLAYER_HEIGHT 42
|
#define PLAYER_HEIGHT 42
|
||||||
#define PLAYER_C_WIDTH 22
|
#define PLAYER_C_WIDTH 30
|
||||||
#define PLAYER_C_HEIGHT 26
|
#define PLAYER_C_HEIGHT 26
|
||||||
#else
|
#else
|
||||||
#define PLAYER_WIDTH 14
|
#define PLAYER_WIDTH 14
|
||||||
|
|
|
@ -565,7 +565,8 @@ void player_bbox_update_system(Scene_t* scene)
|
||||||
|
|
||||||
if ((p_mstate->water_state & 1) && !(p_mstate->ground_state & 1))
|
if ((p_mstate->water_state & 1) && !(p_mstate->ground_state & 1))
|
||||||
{
|
{
|
||||||
#define EXTENDED_WIDTH_FACTOR 1.5f;
|
// Unsure about this extension, keep it for now.
|
||||||
|
#define EXTENDED_WIDTH_FACTOR 1.0f;
|
||||||
float extended_width = p_bbox->size.x * EXTENDED_WIDTH_FACTOR;
|
float extended_width = p_bbox->size.x * EXTENDED_WIDTH_FACTOR;
|
||||||
p_hurtbox->size = p_bbox->size;
|
p_hurtbox->size = p_bbox->size;
|
||||||
p_hurtbox->size.x *= EXTENDED_WIDTH_FACTOR;
|
p_hurtbox->size.x *= EXTENDED_WIDTH_FACTOR;
|
||||||
|
@ -580,7 +581,7 @@ void player_bbox_update_system(Scene_t* scene)
|
||||||
},
|
},
|
||||||
anchor
|
anchor
|
||||||
);
|
);
|
||||||
p_hitbox->boxes[0].x = offset.x;
|
p_hitbox->boxes[0].x = offset.x * p_mstate->x_dir > 0 ? 1 : -1;
|
||||||
|
|
||||||
offset = shift_bbox(
|
offset = shift_bbox(
|
||||||
p_bbox->size,
|
p_bbox->size,
|
||||||
|
@ -589,7 +590,7 @@ void player_bbox_update_system(Scene_t* scene)
|
||||||
},
|
},
|
||||||
anchor
|
anchor
|
||||||
);
|
);
|
||||||
p_hitbox->boxes[1].x = offset.x;
|
p_hitbox->boxes[1].x = (offset.x + 1) * p_mstate->x_dir > 0 ? 1 : -1;
|
||||||
|
|
||||||
p_hurtbox->offset = shift_bbox(p_bbox->size, p_hurtbox->size, anchor);
|
p_hurtbox->offset = shift_bbox(p_bbox->size, p_hurtbox->size, anchor);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue