Add look up NPC info
This commit is contained in:
@@ -502,6 +502,25 @@ public class CECNPCMan : IMsgHandler
|
||||
|
||||
return npc;
|
||||
}
|
||||
|
||||
// Find first NPC/Monster by template id (tid). Used by UI auto-move coordinate resolving.
|
||||
// 通过模板ID(tid)查找第一个NPC/怪物。用于UI自动寻路坐标解析。
|
||||
public CECNPC FindNPCByTemplateID(int tid)
|
||||
{
|
||||
if (tid == 0) return null;
|
||||
|
||||
foreach (var npc in m_NPCTab.Values)
|
||||
{
|
||||
if (!npc) continue;
|
||||
var info = npc.GetNPCInfo();
|
||||
if (info.tid == tid || info.vis_tid == tid)
|
||||
{
|
||||
return npc;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public CECNPC GetNPCFromAll(int nid)
|
||||
{
|
||||
CECNPC pNPC = GetNPC(nid);
|
||||
|
||||
Reference in New Issue
Block a user