From 4a9f9455cb6deada3152f9d3fc8b1d3285e2066a Mon Sep 17 00:00:00 2001 From: FreezePhoenix <24441367+FreezePhoenix@users.noreply.github.com> Date: Sun, 19 May 2024 16:17:24 -0400 Subject: [PATCH] Fix negative max_mp obtainable with withdrawal debuff (#139) This code change makes it so that the player can no longer obtain a negative max_mp. --- node/server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/node/server.js b/node/server.js index 18f783e..8a736cb 100644 --- a/node/server.js +++ b/node/server.js @@ -1307,6 +1307,7 @@ function calculate_player_stats(player) { //player.max_hp+=player.str*5+player.vit*player.level/2; //player.str*10.0+player.level*10+player.vit*25 player.max_hp += player.str * 21 + player.vit * (48 + player.level / 3.0); player.max_hp = max(1, player.max_hp); + player.max_mp = max(1, player.max_mp); player.max_mp += player.int * 15.0 + player.level * 5; //player.armor+=player.str/2.0; player.armor += min(player.str, 160) + max(0, player.str - 160) * 0.25;