forked from EXTERNAL/bareiron
Don't take fall damage in creative or spectator
This commit is contained in:
@@ -215,7 +215,7 @@ 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) {
|
if (damage > 0 && (GAMEMODE == 0 || GAMEMODE == 2)) {
|
||||||
uint8_t block_feet = getBlockAt(player->x, player->y, player->z);
|
uint8_t block_feet = getBlockAt(player->x, player->y, player->z);
|
||||||
if (block_feet < B_water || block_feet > B_water + 7) {
|
if (block_feet < B_water || block_feet > B_water + 7) {
|
||||||
hurtEntity(client_fd, -1, D_fall, damage);
|
hurtEntity(client_fd, -1, D_fall, damage);
|
||||||
|
Reference in New Issue
Block a user