forked from EXTERNAL/bareiron
make flowing water break falls
This commit is contained in:
@@ -187,9 +187,12 @@ void handlePacket (int client_fd, int length, int packet_id, int state) {
|
|||||||
// Handle fall damage
|
// Handle fall damage
|
||||||
if (on_ground) {
|
if (on_ground) {
|
||||||
int16_t damage = player->grounded_y - player->y - 3;
|
int16_t damage = player->grounded_y - player->y - 3;
|
||||||
if (damage > 0 && getBlockAt(player->x, player->y, player->z) != B_water) {
|
if (damage > 0) {
|
||||||
|
uint8_t block_feet = getBlockAt(player->x, player->y, player->z);
|
||||||
|
if (block_feet < B_water || block_feet > B_water + 7) {
|
||||||
hurtEntity(client_fd, -1, D_fall, damage);
|
hurtEntity(client_fd, -1, D_fall, damage);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
player->grounded_y = player->y;
|
player->grounded_y = player->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user