cmdask.cpp
上传用户:garry_shen
上传日期:2015-04-15
资源大小:45647k
文件大小:9k
- #include "stdafx.h"
- #include "XmudOS.h"
- #include "CommandCheck.h"
- #include "CmdPlayerLogon.h"
- #include "mapMapInfo.h"
- #include "npcNpc.h"
- #include "skillskillSkill.h"
- extern rmfullglobals myglobs;
- void CCommandCheck::AskProc(LPVOID pvPlayer,char *szWho, char * szSth1, char * szSth2, char *Result)//ask npc
- {
- CPlayerInfo *lpPlayerInfo;
- CNpc * lpNpc;
- CBaseMap * lpDataMap;
- BOOL bFindOppNPC = FALSE;
- lpPlayerInfo = (CPlayerInfo*)pvPlayer;
- if (lpPlayerInfo->nStatus != AOS_none) return;
- POSITION pMapPosite = lpPlayerInfo->pMapPosite;
- EnterCriticalSection(&myglobs.csMaplist);
- EnterCriticalSection(&myglobs.csPlayerData);
- lpDataMap = maplist.GetAt(lpPlayerInfo->pMapPosite);
- POSITION pos = lpDataMap->listNpc.GetHeadPosition();
- while(pos != NULL) {
- lpNpc = lpDataMap->listNpc.GetNext(pos);
- if(!stricmp(lpNpc->szEName,szWho) || !stricmp(lpNpc->szCName,szWho)) {
- if(lpNpc->nStatus != 0) {
- wsprintf(Result,"%s FAIL %sタΓ帝㎡!", SZASK, lpNpc->szCName);
- LeaveCriticalSection(&myglobs.csPlayerData);
- LeaveCriticalSection(&myglobs.csMaplist);
- return;
- }
- bFindOppNPC = TRUE;
- break;
- }
- }
- if(!bFindOppNPC) {
- wsprintf(Result,"%s FAIL