diff --git a/build/lua/overrides.ts b/build/lua/overrides.ts index 5e88edf..27a49d6 100644 --- a/build/lua/overrides.ts +++ b/build/lua/overrides.ts @@ -88,46 +88,8 @@ export const overrides: Record = { }, }, }, - - EntIndexToHScript: { - generics: [{ name: 'T', extend: 'CBaseEntity = CBaseEntity' }], - return: 'T | undefined', - }, }; -for (const name of [ - 'FindAllByName', - 'FindAllByNameWithin', - 'FindAllByTarget', - 'FindAllByClassname', - 'FindAllByClassnameWithin', - 'FindAllByModel', - 'FindAllInSphere', -]) { - overrides[`CEntities.${name}`] = { - generics: [{ name: 'T', extend: 'CBaseEntity = CBaseEntity' }], - return: 'T[]', - }; -} - -for (const name of [ - 'FindByClassname', - 'FindByClassnameNearest', - 'FindByClassnameWithin', - 'FindByModel', - 'FindByModelWithin', - 'FindByName', - 'FindByNameNearest', - 'FindByNameWithin', - 'FindByTarget', - 'FindInSphere', -]) { - overrides[`CEntities.${name}`] = { - generics: [{ name: 'T', extend: 'CBaseEntity = CBaseEntity' }], - return: 'T | undefined', - }; -} - for (const name of ['QueueConcept', 'QueueTeamConcept', 'QueueTeamConceptNoSpectators']) { overrides[`CDOTA_BaseNPC.${name}`] = { callback: 'optional', diff --git a/packages/dota-lua-types/types/api.generated.d.ts b/packages/dota-lua-types/types/api.generated.d.ts index dc64473..50480c6 100644 --- a/packages/dota-lua-types/types/api.generated.d.ts +++ b/packages/dota-lua-types/types/api.generated.d.ts @@ -8256,117 +8256,95 @@ declare interface CEntities { * Finds all entities by class name. Returns an array containing all the found * entities. */ - FindAllByClassname(className: string): T[]; + FindAllByClassname(className: string): CBaseEntity[]; /** * Find entities by class name within a radius. */ - FindAllByClassnameWithin( - className: string, - location: Vector, - radius: number, - ): T[]; + FindAllByClassnameWithin(className: string, location: Vector, radius: number): CBaseEntity[]; /** * Find entities by model name. */ - FindAllByModel(modelName: string): T[]; + FindAllByModel(modelName: string): CBaseEntity[]; /** * Find all entities by name. Returns an array containing all the found entities * in it. */ - FindAllByName(name: string): T[]; + FindAllByName(name: string): CBaseEntity[]; /** * Find entities by name within a radius. */ - FindAllByNameWithin(name: string, location: Vector, radius: number): T[]; + FindAllByNameWithin(name: string, location: Vector, radius: number): CBaseEntity[]; /** * Find entities by targetname. */ - FindAllByTarget(target: string): T[]; + FindAllByTarget(target: string): CBaseEntity[]; /** * Find entities within a radius. */ - FindAllInSphere(location: Vector, radius: number): T[]; + FindAllInSphere(location: Vector, radius: number): CBaseEntity[]; /** * Find entities by class name. Pass 'null' to start an iteration, or reference to * a previously found entity to continue a search. */ - FindByClassname( - previous: CBaseEntity | undefined, - className: string, - ): T | undefined; + FindByClassname(previous: CBaseEntity | undefined, className: string): CBaseEntity | undefined; /** * Find entities by class name nearest to a point. */ - FindByClassnameNearest( - className: string, - location: Vector, - radius: number, - ): T | undefined; + FindByClassnameNearest(className: string, location: Vector, radius: number): CBaseEntity | undefined; /** * Find entities by class name within a radius. Pass 'null' to start an iteration, * or reference to a previously found entity to continue a search. */ - FindByClassnameWithin( + FindByClassnameWithin( previous: CBaseEntity | undefined, className: string, location: Vector, radius: number, - ): T | undefined; + ): CBaseEntity | undefined; /** * Find entities by model name. Pass 'null' to start an iteration, or reference to * a previously found entity to continue a search. */ - FindByModel( - previous: CBaseEntity | undefined, - modelName: string, - ): T | undefined; + FindByModel(previous: CBaseEntity | undefined, modelName: string): CBaseEntity | undefined; /** * Find entities by model name within a radius. Pass 'null' to start an iteration, * or reference to a previously found entity to continue a search. */ - FindByModelWithin( + FindByModelWithin( previous: CBaseEntity | undefined, modelName: string, location: Vector, radius: number, - ): T | undefined; + ): CBaseEntity | undefined; /** * Find entities by name. Pass 'null' to start an iteration, or reference to a * previously found entity to continue a search. */ - FindByName(previous: CBaseEntity | undefined, name: string): T | undefined; + FindByName(previous: CBaseEntity | undefined, name: string): CBaseEntity | undefined; /** * Find entities by name nearest to a point. */ - FindByNameNearest( - name: string, - location: Vector, - radius: number, - ): T | undefined; + FindByNameNearest(name: string, location: Vector, radius: number): CBaseEntity | undefined; /** * Find entities by name within a radius. Pass 'null' to start an iteration, or * reference to a previously found entity to continue a search. */ - FindByNameWithin( + FindByNameWithin( previous: CBaseEntity | undefined, name: string, location: Vector, radius: number, - ): T | undefined; + ): CBaseEntity | undefined; /** * Find entities by targetname. Pass 'null' to start an iteration, or reference to * a previously found entity to continue a search. */ - FindByTarget(previous: CBaseEntity | undefined, target: string): T | undefined; + FindByTarget(previous: CBaseEntity | undefined, target: string): CBaseEntity | undefined; /** * Find entities within a radius. Pass 'null' to start an iteration, or reference * to a previously found entity to continue a search. */ - FindInSphere( - previous: CBaseEntity | undefined, - location: Vector, - radius: number, - ): T | undefined; + FindInSphere(previous: CBaseEntity | undefined, location: Vector, radius: number): CBaseEntity | undefined; /** * Begin an iteration over the list of entities. * @@ -10223,7 +10201,7 @@ declare function EmitSoundOnLocationWithCaster(location: Vector, soundName: stri * * @both */ -declare function EntIndexToHScript(entityIndex: EntityIndex): T | undefined; +declare function EntIndexToHScript(entityIndex: EntityIndex): CBaseEntity | undefined; /** * Issue an order from a script table.