mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-01 10:24:30 +07:00
Added CharData to Item#update() parameters -- cannot rely on Riiablo.charData in multiplayer cases
This commit is contained in:
parent
23376c4bdc
commit
9b78c010e9
@ -212,7 +212,7 @@ public class CharData {
|
||||
final int alternate = getAlternate();
|
||||
for (Item item : equipped.values()) {
|
||||
if (item == null) continue;
|
||||
item.update();
|
||||
item.update(this);
|
||||
if (item.bodyLoc == BodyLoc.getAlternate(item.bodyLoc, alternate)) {
|
||||
stats.add(item.props.remaining());
|
||||
Stat stat;
|
||||
@ -298,7 +298,7 @@ public class CharData {
|
||||
break;
|
||||
case EQUIPPED:
|
||||
setEquipped(item.bodyLoc, item);
|
||||
item.update();
|
||||
item.update(this);
|
||||
if (item.bodyLoc == BodyLoc.getAlternate(item.bodyLoc, getAlternate())) {
|
||||
stats.add(item.props.remaining());
|
||||
Stat stat;
|
||||
@ -309,7 +309,7 @@ public class CharData {
|
||||
break;
|
||||
case STORED:
|
||||
store.get(item.storeLoc).add(item);
|
||||
item.update();
|
||||
item.update(this);
|
||||
if (item.storeLoc == INVENTORY && item.type.is(Type.CHAR)) {
|
||||
stats.add(item.props.remaining());
|
||||
}
|
||||
@ -378,7 +378,7 @@ public class CharData {
|
||||
|
||||
public Item setEquipped(BodyLoc bodyLoc, Item item) {
|
||||
Item oldItem = equipped.put(bodyLoc, item);
|
||||
if (item != null) item.update();
|
||||
if (item != null) item.update(this);
|
||||
updateSets(oldItem, item);
|
||||
updateStats();
|
||||
notifyEquippedChanged(bodyLoc, oldItem, item);
|
||||
|
@ -10,6 +10,7 @@ import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Disposable;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
import com.riiablo.CharData;
|
||||
import com.riiablo.CharacterClass;
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.codec.DC6;
|
||||
@ -346,7 +347,7 @@ public class Item extends Actor implements Disposable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
public void update(CharData charData) {
|
||||
if ((flags & COMPACT) == COMPACT) return;
|
||||
props.reset();
|
||||
if (stats[MAGIC_PROPS] != null) props.add(stats[MAGIC_PROPS]);
|
||||
@ -368,12 +369,12 @@ public class Item extends Actor implements Disposable {
|
||||
}
|
||||
}
|
||||
}
|
||||
props.update(Riiablo.charData);
|
||||
props.update(charData);
|
||||
}
|
||||
|
||||
public Details details() {
|
||||
if (details == null) {
|
||||
update();
|
||||
update(Riiablo.charData);
|
||||
details = new Details();
|
||||
}
|
||||
return details;
|
||||
|
Loading…
Reference in New Issue
Block a user