Skip to content

Commit

Permalink
fix(server): Add missing .all and getByID for VirtualEntityGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
xLuxy committed Mar 7, 2024
1 parent 052c8ec commit d32c361
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/js/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
const { addAllGetter } = requireBinding("shared/entity.js");

addAllGetter(alt.VoiceChannel, alt.Enums.BaseObjectType.VOICE_CHANNEL);
addAllGetter(alt.VirtualEntityGroup, alt.Enums.BaseObjectType.VIRTUAL_ENTITY_GROUP);
2 changes: 2 additions & 0 deletions server/src/classes/VirtualEntityGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ extern js::Class sharedVirtualEntityGroupClass;
extern js::Class virtualEntityGroupClass("VirtualEntityGroup", &sharedVirtualEntityGroupClass, nullptr, [](js::ClassTemplate& tpl)
{
tpl.BindToType(alt::IBaseObject::Type::VIRTUAL_ENTITY_GROUP);

tpl.GetByID<alt::IBaseObject::Type::VIRTUAL_ENTITY_GROUP>();
});
4 changes: 4 additions & 0 deletions types/server/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,13 +768,17 @@ declare module "@altv/server" {
export abstract class VirtualEntityGroup extends BaseObject {
readonly maxEntitiesInStream: number;

static readonly all: ReadonlyArray<VirtualEntityGroup>;

public onCreate?(opts: altShared.VirtualEntityGroupCreateOptions): void;
public onDestroy?(): void;

static create(opts: altShared.VirtualEntityGroupCreateOptions): VirtualEntityGroup;

static setFactory(factory: typeof VirtualEntityGroup): void;
static getFactory<T extends VirtualEntityGroup>(): T;

static getByID(id: number): VirtualEntityGroup | null;
}

export abstract class VirtualEntity extends WorldObject {
Expand Down
2 changes: 1 addition & 1 deletion types/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@altv/server",
"version": "0.0.36",
"version": "0.0.37",
"description": "This package contains the type definitions for the alt:V JS module v2 server types",
"types": "index.d.ts",
"files": [
Expand Down

0 comments on commit d32c361

Please sign in to comment.