Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Fix override bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed Apr 6, 2023
1 parent 3dbae04 commit 6d21f39
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 43 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"typedoc": "^0.23.25",
"typedoc-plugin-external-resolver": "^1.0.1",
"typedoc-plugin-markdown": "^3.14.0",
"typedoc-plugin-merge-modules": "^4.0.1",
"typedoc-plugin-missing-exports": "^1.0.0",
"typescript": "4.6.3",
"vite": "^4.2.0",
Expand Down
5 changes: 4 additions & 1 deletion src/core/plugins/core-inventory/server/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,21 +325,24 @@ const Internal = {
itemsToCheck = complexSwap.from;

if ((Athena.systems.inventory.weight.isWeightExceeded([complexSwap.to]), config.weight.player)) {
// console.log('weight exceeded at 1');
InventoryView.storage.resync(player);
return;
}
}

if (info.endType === 'custom' && config.weight.enabled) {
itemsToCheck = complexSwap.to;
if ((Athena.systems.inventory.weight.isWeightExceeded([complexSwap.from]), config.weight.player)) {
if ((Athena.systems.inventory.weight.isWeightExceeded([complexSwap.from]), maxWeight)) {
// console.log('weight exceeded at 2');
InventoryView.storage.resync(player);
return;
}
}

const isWeightExceeded = Athena.systems.inventory.weight.isWeightExceeded([itemsToCheck], maxWeight);
if (isWeightExceeded) {
// console.log('weight exceeded at 3');
InventoryView.storage.resync(player);
return;
}
Expand Down
9 changes: 0 additions & 9 deletions src/core/server/events/playerConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DEFAULT_CONFIG } from '@AthenaServer/athena/main';
import * as alt from 'alt-server';
import { SYSTEM_EVENTS } from '../../shared/enums/system';
import * as Athena from '../api';
import { DevModeOverride } from '../systems/dev';
import ConfigUtil from '../utility/config';

/**
Expand Down Expand Up @@ -35,14 +34,6 @@ async function handlePlayerConnect(player: alt.Player): Promise<void> {
player.visible = false;

Athena.player.safe.setPosition(player, pos.x, pos.y, pos.z);

// ! - Allows Dev Mode to Use First Account or Accounts
if (typeof config !== 'undefined' && config.USE_DEV_MODE) {
alt.log(`~lc~Developer Mode: ~lg~Only one account will be used while using 'dev'`);
DevModeOverride.login(player);
return;
}

Athena.systems.loginFlow.next(player);
}

Expand Down
32 changes: 0 additions & 32 deletions src/core/server/systems/dev.ts

This file was deleted.

15 changes: 15 additions & 0 deletions src/core/server/systems/loginFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ export function next(player: alt.Player) {
playerFlow[player.id].flow[index].callback(player);
}

/**
* Go straight to the final section of login flow. Which is a character select.
*
* @export
* @param {alt.Player} player
*/
export function goToEnd(player: alt.Player) {
if (!playerFlow[player.id]) {
register(player);
}

playerFlow[player.id].index = playerFlow[player.id].flow.length - 1;
playerFlow[player.id].flow[playerFlow[player.id].index].callback(player);
}

alt.on('playerDisconnect', (player: alt.Player) => {
delete playerFlow[player.id];
});
Expand Down

0 comments on commit 6d21f39

Please sign in to comment.