mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-16 15:24:44 +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) {
|
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));
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user