@nativewrappers/server 0.0.167 → 0.0.168

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.
@@ -33,8 +33,11 @@ export declare class Player {
33
33
  /**
34
34
  * Gets the players ped, this is only ever set once, so subsequent calls will be
35
35
  * cached
36
+ *
37
+ * Due to the fact that the ped doesn't exist at `playerJoining` this can be
38
+ * `null`
36
39
  */
37
- get Ped(): Ped;
40
+ get Ped(): Ped | null;
38
41
  get Tokens(): string[];
39
42
  get Identifiers(): string[];
40
43
  get Endpoint(): string;
@@ -61,10 +61,16 @@ class Player {
61
61
  /**
62
62
  * Gets the players ped, this is only ever set once, so subsequent calls will be
63
63
  * cached
64
+ *
65
+ * Due to the fact that the ped doesn't exist at `playerJoining` this can be
66
+ * `null`
64
67
  */
65
68
  get Ped() {
66
69
  if (!this.ped) {
67
- this.ped = new Ped(GetPlayerPed(this.source));
70
+ const ped = GetPlayerPed(this.source);
71
+ if (ped !== 0) {
72
+ this.ped = new Ped(GetPlayerPed(this.source));
73
+ }
68
74
  }
69
75
  return this.ped;
70
76
  }
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.168",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/nativewrappers/nativewrappers.git"