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) {
boolean hasChanged = false;
// Try to set level
if (this.getLevel() > 0) {
avatar.setLevel(this.getLevel());
hasChanged = true;
}
// Try to set level
if (this.getLevel() > 0) {
avatar.setLevel(Math.min(this.getLevel(), 80));

View File

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