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

@@ -31,7 +31,7 @@ public class CharacterRepository {
.bind("max_hp", stats.maxHp())
.bind("max_mp", stats.maxMp())
.bind("ap", stats.ap())
.bind("sp", parseSp(stats.sp()))
.bind("sp", stats.sp())
.bind("job", stats.job())
.bind("fame", stats.fame())
.bind("gender", stats.gender())
@@ -88,7 +88,7 @@ public class CharacterRepository {
.bind("max_hp", stats.maxHp())
.bind("max_mp", stats.maxMp())
.bind("ap", stats.ap())
.bind("sp", parseSp(stats.sp()))
.bind("sp", stats.sp())
.bind("job", stats.job())
.bind("fame", stats.fame())
.bind("gender", stats.gender())
@@ -136,17 +136,4 @@ public class CharacterRepository {
return updatedRows > 0;
}
private int parseSp(String sp) {
if (sp == null) {
return 0;
}
if (!sp.contains(",")) {
return Integer.parseInt(sp);
}
// Old multi skillbook sp to support Evan skills. To be changed - sp will be simple integer in new db.
return Integer.parseInt(sp.split(",")[0]);
}
}