@nativewrappers/server 0.0.76 → 0.0.77

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/common/index.js CHANGED
@@ -999,7 +999,6 @@ function NetEvent(eventName, remoteOnly = true) {
999
999
  throw new Error("NetEvent does not work on private methods, please mark the method as public");
1000
1000
  }
1001
1001
  context.addInitializer(function() {
1002
- const t = this;
1003
1002
  onNet(eventName, (...args) => {
1004
1003
  const src = source;
1005
1004
  try {
@@ -1008,7 +1007,7 @@ function NetEvent(eventName, remoteOnly = true) {
1008
1007
  return;
1009
1008
  }
1010
1009
  }
1011
- return originalMethod.call(t, ...args);
1010
+ return originalMethod.call(this, ...args);
1012
1011
  } catch (e) {
1013
1012
  REMOVE_NET_EVENT_LOG: {
1014
1013
  if (!GlobalData.EnablePrettyPrint) return;
@@ -4,6 +4,7 @@ import type { PopulationType } from "../enum/PopulationType";
4
4
  import type { Hash } from "../type/Hash";
5
5
  import { Vector4 } from "../utils";
6
6
  import { Vector3 } from "../utils";
7
+ import { OrphanMode } from "server/enum";
7
8
  export declare class BaseEntity {
8
9
  protected handle: number;
9
10
  protected type: ClassTypes;
@@ -44,5 +45,7 @@ export declare class BaseEntity {
44
45
  get IsVisible(): boolean;
45
46
  get NetworkId(): number;
46
47
  get IsNoLongerNeeded(): boolean;
48
+ get OrphanMode(): OrphanMode;
49
+ set OrphanMode(orphanMode: OrphanMode);
47
50
  delete(): void;
48
51
  }
@@ -0,0 +1,5 @@
1
+ export declare enum OrphanMode {
2
+ DeleteWhenNotRelevant = 0,
3
+ DeleteOnOwnerDisconnect = 1,
4
+ KeepEntity = 2
5
+ }
package/enum/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export { eEntityType } from "./eEntityType";
2
2
  export { PopulationType } from "./PopulationType";
3
3
  export { VehicleLockStatus } from "./VehicleLockStatus";
4
4
  export { VehicleType } from "./VehicleType";
5
+ export { OrphanMode } from "./OrphanMode";
package/index.js CHANGED
@@ -823,6 +823,12 @@ var BaseEntity = class _BaseEntity {
823
823
  get IsNoLongerNeeded() {
824
824
  return HasEntityBeenMarkedAsNoLongerNeeded(this.handle);
825
825
  }
826
+ get OrphanMode() {
827
+ return GetEntityOrphanMode(this.Handle);
828
+ }
829
+ set OrphanMode(orphanMode) {
830
+ SetEntityOrphanMode(this.Handle, orphanMode);
831
+ }
826
832
  delete() {
827
833
  if (this.Exists) {
828
834
  DeleteEntity(this.handle);
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  ],
9
9
  "license": "MIT",
10
10
  "type": "module",
11
- "version": "0.0.76",
11
+ "version": "0.0.77",
12
12
  "repository": {
13
13
  "type": "git",
14
14
  "url": "https://github.com/nativewrappers/nativewrappers.git"