Fix avatar properties not being changed when using /giveall

This commit is contained in:
Melledy
2023-11-25 18:40:56 -08:00
parent d14e9bda79
commit 7b3ad329b7
2 changed files with 7 additions and 13 deletions

View File

@@ -94,13 +94,7 @@ public class CommandArgs {
*/ */
public boolean setProperties(GameAvatar avatar) { public boolean setProperties(GameAvatar avatar) {
boolean hasChanged = false; boolean hasChanged = false;
// Try to set level
if (this.getLevel() > 0) {
avatar.setLevel(this.getLevel());
hasChanged = true;
}
// Try to set level // Try to set level
if (this.getLevel() > 0) { if (this.getLevel() > 0) {
avatar.setLevel(Math.min(this.getLevel(), 80)); avatar.setLevel(Math.min(this.getLevel(), 80));

View File

@@ -96,12 +96,12 @@ public class GiveAllCommand implements CommandHandler {
} }
// Add avatar // Add avatar
target.getInventory().addItem(excel, 1); var avatarExcel = GameData.getAvatarExcelMap().get(excel.getId());
if (avatarExcel != null) {
// Set avatar properties GameAvatar avatar = new GameAvatar(avatarExcel);
GameAvatar avatar = target.getAvatarById(excel.getId()); args.setProperties(avatar); // Set avatar properties
if (avatar != null) {
args.setProperties(avatar); target.getAvatars().addAvatar(avatar);
} }
} else if (excel.getItemSubType() == ItemSubType.Eidolon) { } else if (excel.getItemSubType() == ItemSubType.Eidolon) {
// Add eidolons // Add eidolons