From f5509d1e7dcad132a78e0d5cc8a68d3b66a59455 Mon Sep 17 00:00:00 2001 From: hatsune-miku Date: Mon, 9 May 2022 17:51:46 -0230 Subject: [PATCH] Disable falling damage for godmode --- .../server/packet/recv/HandlerCombatInvocationsNotify.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java index 50fca5101..1ce089c26 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java @@ -102,6 +102,10 @@ public class HandlerCombatInvocationsNotify extends PacketHandler { if (cachedLandingSpeed < -28) { damageFactor = 1f; } + // Disable falling damage for players in god mode. + if (session.getPlayer() != null && session.getPlayer().inGodmode()) { + damageFactor = 0; + } float damage = maxHP * damageFactor; float newHP = currentHP - damage; if (newHP < 0) {