Simplify sp saving

This commit is contained in:
P0nk
2024-09-25 18:07:50 +02:00
parent b4e673baab
commit 7335914695
4 changed files with 7 additions and 27 deletions

View File

@@ -39,7 +39,7 @@ public abstract class AbstractCharacterObject extends AbstractAnimatedMapObject
protected MapleMap map;
protected int str, dex, luk, int_, hp, maxhp, mp, maxmp;
protected int hpMpApUsed, remainingAp;
protected int[] remainingSp = new int[10];
protected int[] remainingSp = new int[10]; // TODO: change to a simple int. Evan is not in v83, so why support it?
protected transient int clientmaxhp, clientmaxmp, localmaxhp = 50, localmaxmp = 5;
protected float transienthp = Float.NEGATIVE_INFINITY, transientmp = Float.NEGATIVE_INFINITY;

View File

@@ -8451,7 +8451,7 @@ public class Character extends AbstractCharacterObject {
ps.setInt(10, stats.mp());
ps.setInt(11, stats.maxHp());
ps.setInt(12, stats.maxMp());
ps.setString(13, stats.sp());
ps.setString(13, String.valueOf(stats.sp()));
ps.setInt(14, stats.ap());
ps.setInt(15, stats.gmLevel());
ps.setInt(16, stats.skin());
@@ -8566,15 +8566,8 @@ public class Character extends AbstractCharacterObject {
.mp(mp)
.maxHp(maxhp)
.maxMp(maxmp)
.ap(remainingAp);
StringBuilder sps = new StringBuilder();
for (int j : remainingSp) {
sps.append(j);
sps.append(",");
}
String sp = sps.toString();
builder.sp(sp.substring(0, sp.length() - 1));
.ap(remainingAp)
.sp(remainingSp[0]);
} finally {
statWlock.unlock();
effLock.unlock();

View File

@@ -20,7 +20,7 @@ public record CharacterStats(
int mp,
int maxHp,
int maxMp,
String sp,
int sp,
int ap,
int gmLevel,
int skin,