本文整理汇总了C++中CNpc::isGate方法的典型用法代码示例。如果您正苦于以下问题:C++ CNpc::isGate方法的具体用法?C++ CNpc::isGate怎么用?C++ CNpc::isGate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNpc
的用法示例。
在下文中一共展示了CNpc::isGate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecvGateOpen
void CGameSocket::RecvGateOpen(Packet & pkt)
{
uint16 nid;
bool byGateOpen;
pkt >> nid >> byGateOpen;
if (nid < NPC_BAND)
{
TRACE("#### RecvGateOpen() nid Fail --> nid = %d ####\n", nid);
return;
}
CNpc* pNpc = g_pMain->m_arNpc.GetData(nid);
if (pNpc == nullptr)
return;
if (!pNpc->isGate())
{
TRACE("#### RecvGateOpen() NpcType Fail --> type = %d ####\n", pNpc->GetType());
return;
}
pNpc->m_byGateOpen = byGateOpen;
TRACE("**** RecvGateOpen()---> nid = %d, byGateOpen = %d ******\n", nid, byGateOpen);
}
示例2: RecvGateOpen
void CAISocket::RecvGateOpen( char* pBuf )
{
int index = 0, nNid = 0, nSid = 0, nGateFlag = 0;
CNpc* pNpc = NULL;
_OBJECT_EVENT* pEvent = NULL;
nNid = GetShort(pBuf, index);
nSid = GetShort(pBuf, index);
nGateFlag = GetByte(pBuf, index);
pNpc = m_pMain->m_arNpcArray.GetData(nNid);
if (pNpc == NULL)
{
TRACE("#### RecvGateOpen Npc Pointer null : nid=%d ####\n", nNid);
return;
}
pNpc->m_byGateOpen = nGateFlag; // possibly not needed (we'll do it below), but need to make sure.
pEvent = pNpc->GetMap()->GetObjectEvent(nSid);
if (pEvent == NULL)
{
TRACE("#### RecvGateOpen Npc Object fail : nid=%d, sid=%d ####\n", nNid, nSid);
return;
}
//TRACE("---> RecvGateOpen Npc Object fail : nid=%d, sid=%d, nGateFlag = %d ####\n", nNid, nSid, nGateFlag);
if (pNpc->isGate())
pNpc->SendGateFlag(nGateFlag, false);
}