Skip to content

Commit 5ee3b2a

Browse files
committed
fix(server/player): check character slots on character creation
1 parent 561adc8 commit 5ee3b2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/player/class.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { PayAccountInvoice } from 'accounts';
2727
import type { Character, Dict, NewCharacter, PlayerMetadata, OxGroup, CharacterLicense } from 'types';
2828
import { GetGroupPermissions } from '../../common';
2929
import { Licenses } from './license';
30+
import { CHARACTER_SLOTS } from 'config';
3031

3132
export class OxPlayer extends ClassInterface {
3233
source: number | string;
@@ -477,7 +478,7 @@ export class OxPlayer extends ClassInterface {
477478

478479
/** Registers a new character for the player. */
479480
async createCharacter(data: NewCharacter) {
480-
if (this.charId) return;
481+
if (this.charId || this.#characters.length >= CHARACTER_SLOTS) return;
481482

482483
const stateId = await this.#generateStateId();
483484
const phoneNumber = await GeneratePhoneNumber();

0 commit comments

Comments
 (0)