mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-19 16:57:20 +07:00
Fixes stat mismatch between current and max -- will likely require more modifications to apply all current mods to max stat
This commit is contained in:
parent
a019755a96
commit
acdf053a76
@ -226,6 +226,11 @@ public class CharData {
|
||||
}
|
||||
stats.update(this);
|
||||
|
||||
// FIXME: This corrects a mismatch between max and current, algorithm should be tested later for correctness in other cases
|
||||
stats.get(Stat.maxstamina).set(stats.get(Stat.stamina));
|
||||
stats.get(Stat.maxhp).set(stats.get(Stat.hitpoints));
|
||||
stats.get(Stat.maxmana).set(stats.get(Stat.mana));
|
||||
|
||||
// This appears to be hard-coded in the original client
|
||||
int dex = stats.get(Stat.dexterity).value();
|
||||
Stat armorclass = stats.get(Stat.armorclass);
|
||||
|
@ -594,6 +594,14 @@ public class Stat implements Comparable<Stat>, Pool.Poolable {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Intended for correcting maxhp, maxstamina and maxmana, see note in CharData
|
||||
public Stat set(Stat other) {
|
||||
val = other.val;
|
||||
other.modified = modified;
|
||||
modified = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
private static final StringBuilder builder = new StringBuilder(32);
|
||||
private static final CharSequence SPACE = Riiablo.string.lookup("space");
|
||||
private static final CharSequence DASH = Riiablo.string.lookup("dash");
|
||||
|
Loading…
Reference in New Issue
Block a user