Remove hair works again

This commit is contained in:
Dennis Postma 2025-02-18 18:00:20 +01:00
parent 66fc6d8b43
commit 78daac9d95

View File

@ -37,7 +37,7 @@ export default class CharacterConnectEvent extends BaseEvent {
this.socket.characterId = character.id
// Set character hair
if (data.characterHairId !== undefined && data.characterHairId !== null) {
if (data.characterHairId !== undefined) {
const characterHair = await this.characterHairRepository.getById(data.characterHairId)
await character.setCharacterHair(characterHair).save()
}
@ -62,7 +62,7 @@ export default class CharacterConnectEvent extends BaseEvent {
}
private async checkForActiveCharacters(): Promise<boolean> {
const characters = await this.characterRepository.getByUserId(this.socket.userId)
const characters = await this.characterRepository.getByUserId(this.socket.userId!)
return characters?.some((char) => MapManager.getCharacterById(char.id)) ?? false
}
}