mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 05:44:36 +01:00
Fix avatar properties not being changed when using /giveall
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user