Skip to content

Commit

Permalink
fix(server/player): check character slots on character creation
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Oct 26, 2024
1 parent 561adc8 commit 5ee3b2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/player/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { PayAccountInvoice } from 'accounts';
import type { Character, Dict, NewCharacter, PlayerMetadata, OxGroup, CharacterLicense } from 'types';
import { GetGroupPermissions } from '../../common';
import { Licenses } from './license';
import { CHARACTER_SLOTS } from 'config';

export class OxPlayer extends ClassInterface {
source: number | string;
Expand Down Expand Up @@ -477,7 +478,7 @@ export class OxPlayer extends ClassInterface {

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

const stateId = await this.#generateStateId();
const phoneNumber = await GeneratePhoneNumber();
Expand Down

0 comments on commit 5ee3b2a

Please sign in to comment.