9663 【越南】【BT7】【主干】防范NPC获取刷新点坐标报错
| | |
| | | return
|
| | |
|
| | | PosMap = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | | if not PosMap:
|
| | | return
|
| | | posMapX = PosMap.GetPosX()
|
| | | posMapY = PosMap.GetPosY()
|
| | | #posMapArea = PosMap.GetArea() # 刷怪区域
|
| | |
| | | #检查是否超出活动范围
|
| | | if curNPC.GetRefreshPosCount() > 0:
|
| | | curRefreshPos = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
|
| | | if not curRefreshPos:
|
| | | return
|
| | | moveDist = GameWorld.GetDist(posX, posY, curRefreshPos.GetPosX(), curRefreshPos.GetPosY())
|
| | | if curRefreshPos.GetMoveDist() != 0 and moveDist > curRefreshPos.GetMoveDist():
|
| | | #如果NPC超过自己的移动范围, 就自动返回
|
| | |
| | | return
|
| | |
|
| | | posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
|
| | | if not posMap:
|
| | | return
|
| | | #范围校验
|
| | | posMapX = posMap.GetPosX()
|
| | | posMapY = posMap.GetPosY()
|