Skip to content

Commit

Permalink
fix: sync position bug... pain
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed May 23, 2024
1 parent 48a9be0 commit 2833554
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/server/player/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export function useState(player: alt.Player) {
* @param {Partial<BaseCharacter>} document
*/
function apply(document: Partial<BaseCharacter>) {
console.log(document);

if (document.pos) {
console.log(document.pos);
player.pos = new alt.Vector3(document.pos.x, document.pos.y, document.pos.z);
}

Expand Down Expand Up @@ -62,7 +65,7 @@ export function useState(player: alt.Player) {
function sync() {
const document = Rebar.document.character.useCharacter(player);
const data = document.get();
if (!data || !data.weapons) {
if (!data) {
return;
}

Expand Down

0 comments on commit 2833554

Please sign in to comment.