Skip to content

Commit bbf9d16

Browse files
author
Picoseconds
committed
fix: fix cheese showing 0 heal
1 parent a3b2443 commit bbf9d16

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/moomoo/Player.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,17 @@ export default class Player extends Entity {
9696
}
9797

9898
if (this.foodHealOverTimeAmt < this.maxFoodHealOverTime) {
99-
this.client?.socket.send(
100-
packetFactory.serializePacket(
101-
new Packet(
102-
PacketType.HEALTH_CHANGE,
103-
[this.location.x, this.location.y, -Math.min(100 - this.health, this.foodHealOverTime), 1]
99+
if (100 - this.health > 0) {
100+
this.client?.socket.send(
101+
packetFactory.serializePacket(
102+
new Packet(
103+
PacketType.HEALTH_CHANGE,
104+
[this.location.x, this.location.y, -Math.min(100 - this.health, this.foodHealOverTime), 1]
105+
)
104106
)
105-
)
106-
);
107-
this.health = Math.min(this.health + this.foodHealOverTime, 100);
107+
);
108+
this.health = Math.min(this.health + this.foodHealOverTime, 100);
109+
}
108110

109111
this.foodHealOverTimeAmt++;
110112
} else {

0 commit comments

Comments
 (0)