ML-Server: NPC Names client sided
This commit is contained in:
@@ -1954,6 +1954,7 @@ typedef struct SPacketGCRefineInformaion
|
||||
struct TNPCPosition
|
||||
{
|
||||
uint8_t bType;
|
||||
uint32_t dwVnum;
|
||||
char name[CHARACTER_NAME_MAX_LEN+1];
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
|
||||
@@ -676,6 +676,7 @@ bool regen_load(const char* filename, long lMapIndex, int base_x, int base_y)
|
||||
{
|
||||
SECTREE_MANAGER::instance().InsertNPCPosition(lMapIndex,
|
||||
p->m_table.bType,
|
||||
p->m_table.dwVnum,
|
||||
p->m_table.szLocaleName,
|
||||
(regen->sx+regen->ex) / 2 - base_x,
|
||||
(regen->sy+regen->ey) / 2 - base_y);
|
||||
|
||||
@@ -1145,6 +1145,7 @@ void SECTREE_MANAGER::SendNPCPosition(LPCHARACTER ch)
|
||||
for (auto it = m_mapNPCPosition[lMapIndex].begin(); it != m_mapNPCPosition[lMapIndex].end(); ++it)
|
||||
{
|
||||
np.bType = it->bType;
|
||||
np.dwVnum = it->dwVnum;
|
||||
strlcpy(np.name, it->name, sizeof(np.name));
|
||||
np.x = it->x;
|
||||
np.y = it->y;
|
||||
@@ -1162,9 +1163,9 @@ void SECTREE_MANAGER::SendNPCPosition(LPCHARACTER ch)
|
||||
d->Packet(&p, sizeof(TPacketGCNPCPosition));
|
||||
}
|
||||
|
||||
void SECTREE_MANAGER::InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y)
|
||||
void SECTREE_MANAGER::InsertNPCPosition(long lMapIndex, BYTE bType, DWORD dwVnum, const char* szName, long x, long y)
|
||||
{
|
||||
m_mapNPCPosition[lMapIndex].push_back(npc_info(bType, szName, x, y));
|
||||
m_mapNPCPosition[lMapIndex].push_back(npc_info(bType, dwVnum, szName, x, y));
|
||||
}
|
||||
|
||||
BYTE SECTREE_MANAGER::GetEmpireFromMapIndex(long lMapIndex)
|
||||
|
||||
@@ -27,10 +27,11 @@ struct TAreaInfo
|
||||
struct npc_info
|
||||
{
|
||||
BYTE bType;
|
||||
DWORD dwVnum;
|
||||
const char* name;
|
||||
long x, y;
|
||||
npc_info(BYTE bType, const char* name, long x, long y)
|
||||
: bType(bType), name(name), x(x), y(y)
|
||||
npc_info(BYTE bType, DWORD dwVnum, const char* name, long x, long y)
|
||||
: bType(bType), dwVnum(dwVnum), name(name), x(x), y(y)
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -155,7 +156,7 @@ class SECTREE_MANAGER : public singleton<SECTREE_MANAGER>
|
||||
|
||||
TAreaMap& GetDungeonArea(long lMapIndex);
|
||||
void SendNPCPosition(LPCHARACTER ch);
|
||||
void InsertNPCPosition(long lMapIndex, BYTE bType, const char* szName, long x, long y);
|
||||
void InsertNPCPosition(long lMapIndex, BYTE bType, DWORD dwVnum, const char* szName, long x, long y);
|
||||
|
||||
BYTE GetEmpireFromMapIndex(long lMapIndex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user