@nativewrappers/server 0.0.167 → 0.0.169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,10 +31,9 @@ export declare class Player {
31
31
  */
32
32
  get Src(): string;
33
33
  /**
34
- * Gets the players ped, this is only ever set once, so subsequent calls will be
35
- * cached
34
+ * Gets the player ped
36
35
  */
37
- get Ped(): Ped;
36
+ get Ped(): Ped | null;
38
37
  get Tokens(): string[];
39
38
  get Identifiers(): string[];
40
39
  get Endpoint(): string;
@@ -59,14 +59,12 @@ class Player {
59
59
  return this.source;
60
60
  }
61
61
  /**
62
- * Gets the players ped, this is only ever set once, so subsequent calls will be
63
- * cached
62
+ * Gets the player ped
64
63
  */
65
64
  get Ped() {
66
- if (!this.ped) {
67
- this.ped = new Ped(GetPlayerPed(this.source));
68
- }
69
- return this.ped;
65
+ const ped = GetPlayerPed(this.source);
66
+ if (ped === 0) return null;
67
+ return new Ped(ped);
70
68
  }
71
69
  get Tokens() {
72
70
  return getPlayerTokens(this.source);
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "license": "MIT",
10
10
  "type": "module",
11
- "version": "0.0.167",
11
+ "version": "0.0.169",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/nativewrappers/nativewrappers.git"