mirror of
https://github.com/bdnugget/rs-sdk.git
synced 2026-11-07 09:07:30 +00:00
feat(sdk): publish npc type id on NearbyNpc
Filters written as npc.id === configId were comparing undefined === n and failing silently - NearbyNpc only carried the world slot (index) and name, unlike every other published entity. Surface NpcType.id (npc.pack config id) on both the collector and the SDK type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e4cb65ec47
commit
931ebe0514
3 files changed
+11
No files matched your search
@@ -78,6 +78,11 @@ export interface NpcOption {
|
||||
export interface NearbyNpc {
|
||||
/** Discriminator so npc and player targets can share one API. */
|
||||
kind: 'npc';
|
||||
/**
|
||||
* NPC type/config id (matches server/content npc.pack). Not the world
|
||||
* slot - interact packets address `index`.
|
||||
*/
|
||||
id: number;
|
||||
index: number;
|
||||
name: string;
|
||||
combatLevel: number;
|
||||
|
||||
@@ -951,6 +951,7 @@ export class BotStateCollector implements ScanProvider {
|
||||
|
||||
npcs.push({
|
||||
kind: 'npc',
|
||||
id: npcType.id,
|
||||
index: npcIndex,
|
||||
name: npcType.name || 'Unknown',
|
||||
combatLevel: npcType.vislevel || 0,
|
||||
|
||||
@@ -70,6 +70,11 @@ export interface NpcOption {
|
||||
export interface NearbyNpc {
|
||||
/** Discriminator so npc and player targets can share one API. */
|
||||
kind: 'npc';
|
||||
/**
|
||||
* NPC type/config id (matches server/content npc.pack). Not the world
|
||||
* slot - interact packets address `index`.
|
||||
*/
|
||||
id: number;
|
||||
index: number;
|
||||
name: string;
|
||||
combatLevel: number;
|
||||
|
||||
Reference in new issue
Block a user