@nativewrappers/fivem 0.0.41 → 0.0.42
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.
- package/client/Model.d.ts +1 -1
- package/client/Model.js +2 -2
- package/common/utils/Vector.d.ts +1 -1
- package/common/utils/Vector.js +6 -6
- package/package.json +1 -1
package/client/Model.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ export declare class Model {
|
|
|
126
126
|
* This function will not automatically set the model as no longer needed when
|
|
127
127
|
* done.
|
|
128
128
|
*
|
|
129
|
-
* @param
|
|
129
|
+
* @param timeoutMs Maximum allowed time for model to load.
|
|
130
130
|
*/
|
|
131
131
|
request(timeoutMs?: number): Promise<boolean>;
|
|
132
132
|
/**
|
package/client/Model.js
CHANGED
|
@@ -173,7 +173,7 @@ export class Model {
|
|
|
173
173
|
* This function will not automatically set the model as no longer needed when
|
|
174
174
|
* done.
|
|
175
175
|
*
|
|
176
|
-
* @param
|
|
176
|
+
* @param timeoutMs Maximum allowed time for model to load.
|
|
177
177
|
*/
|
|
178
178
|
async request(timeoutMs = 1000) {
|
|
179
179
|
if (!this.IsInCdImage && !this.IsValid && !IsWeaponValid(this.hash)) {
|
|
@@ -185,7 +185,7 @@ export class Model {
|
|
|
185
185
|
}
|
|
186
186
|
RequestModel(this.hash);
|
|
187
187
|
const timeout = GetGameTimer() + timeoutMs;
|
|
188
|
-
while (!this.IsLoaded &&
|
|
188
|
+
while (!this.IsLoaded && GetGameTimer() < timeout) {
|
|
189
189
|
await Wait(0);
|
|
190
190
|
}
|
|
191
191
|
return this.IsLoaded;
|
package/common/utils/Vector.d.ts
CHANGED
package/common/utils/Vector.js
CHANGED
|
@@ -59,9 +59,9 @@ export class Vector {
|
|
|
59
59
|
const isNumber = typeof b === 'number';
|
|
60
60
|
x = operator(x, isNumber ? b : (b.x ?? 0));
|
|
61
61
|
y = operator(y, isNumber ? b : (b.y ?? 0));
|
|
62
|
-
if (z)
|
|
62
|
+
if (z !== undefined)
|
|
63
63
|
z = operator(z, isNumber ? b : (b.z ?? 0));
|
|
64
|
-
if (w)
|
|
64
|
+
if (w !== undefined)
|
|
65
65
|
w = operator(w, isNumber ? b : (b.w ?? 0));
|
|
66
66
|
return this.create(x, y, z, w);
|
|
67
67
|
}
|
|
@@ -157,9 +157,9 @@ export class Vector {
|
|
|
157
157
|
const isNumber = typeof b === 'number';
|
|
158
158
|
x = operator(Math.abs(x), isNumber ? b : Math.abs(b.x ?? 0));
|
|
159
159
|
y = operator(Math.abs(y), isNumber ? b : Math.abs(b.y ?? 0));
|
|
160
|
-
if (z)
|
|
160
|
+
if (z !== undefined)
|
|
161
161
|
z = operator(Math.abs(z), isNumber ? b : Math.abs(b.z ?? 0));
|
|
162
|
-
if (w)
|
|
162
|
+
if (w !== undefined)
|
|
163
163
|
w = operator(Math.abs(w), isNumber ? b : Math.abs(b.w ?? 0));
|
|
164
164
|
return this.create(x, y, z, w);
|
|
165
165
|
}
|
|
@@ -367,8 +367,8 @@ export class Vector {
|
|
|
367
367
|
/**
|
|
368
368
|
* @see Vector.addY
|
|
369
369
|
*/
|
|
370
|
-
addY(
|
|
371
|
-
return Vector.addY(this,
|
|
370
|
+
addY(y) {
|
|
371
|
+
return Vector.addY(this, y);
|
|
372
372
|
}
|
|
373
373
|
/**
|
|
374
374
|
* @see Vector.subtract
|