Remove default Anemo skill depot from a Traveler when questing is enabled

This commit is contained in:
KingRainbow44 2023-04-13 17:52:26 -04:00
parent ecd0ea7a8c
commit 38ba9771ec
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -1,6 +1,7 @@
package emu.grasscutter.server.packet.recv;
import static emu.grasscutter.config.Configuration.GAME_INFO;
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter;
@ -50,8 +51,13 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler {
// Create avatar
if (player.getAvatars().getAvatarCount() == 0) {
Avatar mainCharacter = new Avatar(avatarId);
mainCharacter.setSkillDepotData(
// Check if the default Anemo skill should be given.
if (!GAME_OPTIONS.questing) {
mainCharacter.setSkillDepotData(
GameData.getAvatarSkillDepotDataMap().get(startingSkillDepot));
}
// Manually handle adding to team
player.addAvatar(mainCharacter, false);
player.setMainCharacterId(avatarId);