本文整理汇总了C++中Obj_Human::GetAbilityList方法的典型用法代码示例。如果您正苦于以下问题:C++ Obj_Human::GetAbilityList方法的具体用法?C++ Obj_Human::GetAbilityList怎么用?C++ Obj_Human::GetAbilityList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_Human
的用法示例。
在下文中一共展示了Obj_Human::GetAbilityList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
UINT CGAskDetailAbilityInfoHandler::Execute( CGAskDetailAbilityInfo* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
GamePlayer* pGamePlayer = (GamePlayer*)pPlayer;
Assert( pGamePlayer );
Obj_Human* pHuman = pGamePlayer->GetHuman();
Assert( pHuman );
Scene* pScene = pHuman->getScene();
if( pScene==NULL )
{
Assert(FALSE);
return PACKET_EXE_ERROR;
}
//检查线程执行资源是否正确
Assert( MyGetCurrentThreadID()==pScene->m_ThreadID );
ObjID_t ObjID = pHuman->GetID();
if( ObjID == INVALID_ID )
{
Assert(FALSE);
return PACKET_EXE_ERROR;
}
Obj_Human *pTarget = (Obj_Human*)(pScene->GetObjManager()->GetObj(pPacket->getTargetID()));
if( pTarget==NULL )
{
Assert( pTarget );
return PACKET_EXE_ERROR;
}
// 权限判断
// to be continue...
if ( pTarget->GetObjType() != Obj::OBJ_TYPE_HUMAN )
{
return PACKET_EXE_ERROR;
}
GCDetailAbilityInfo Msg;
Msg.setObjID( pTarget->GetID() );
const _ABILITY_LIST *pAbilityList = pTarget->GetAbilityList();
Msg.setAbilityList( g_pAbilityManager->MaxAbilityNum(), pAbilityList->m_aABility, pAbilityList->m_aPrescr );
pGamePlayer->SendPacket( &Msg );
g_pLog->FastSaveLog( LOG_FILE_1, "CGAskDetailAbilityInfoHandler: ok obj=%d scene=%d",
ObjID, pScene->SceneID() );
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}