Fix players having broken character honor titles

This commit is contained in:
Melledy committed 2026-10-23 23:44:15 -07:00
1 parent 4a2ab5cd48
commit b361ee774d
2 files changed
+23

No files matched your search

@@ -284,6 +284,14 @@ public class Inventory extends PlayerManager implements GameDatabaseObject {
return false;
}
// Get honor data
var honor = GameData.getHonorDataTable().get(id);
// Skip character honor as those are tied to characters
if (honor == null || honor.isCharacterHonor()) {
return false;
}
// Add
this.getHonorList().add(id);
@@ -854,6 +854,21 @@ public class Player implements GameDatabaseObject {
Nebula.getGameDatabase().update(this, this.getUid(), "monthlyCardLastRewardDays", this.monthlyCardLastRewardDays);
}
// Players should not have character honor titles in their honor list
for (int id : this.getInventory().getHonorList()) {
boolean honorChanged = false;
var honor = GameData.getHonorDataTable().get(id);
if (honor == null || honor.isCharacterHonor()) {
this.getInventory().getHonorList().remove(id);
honorChanged = true;
}
if (honorChanged) {
Nebula.getGameDatabase().update(this.getInventory(), this.getUid(), "honorList", this.getInventory().getHonorList());
}
}
// Init activities
this.getActivityManager().init();