这篇教程C++ GetMover函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetMover函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMover函数的具体用法?C++ GetMover怎么用?C++ GetMover使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetMover函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetMoverbool AntiCheat::CheckFly(){ if (GetMover()->GetTerrain()->IsUnderWater(m_currentmovementInfo->GetPos()->x, m_currentmovementInfo->GetPos()->y, m_currentmovementInfo->GetPos()->z - 2.0f)) return true; if (!m_currentmovementInfo->HasMovementFlag(MovementFlags(MOVEFLAG_CAN_FLY | MOVEFLAG_FLYING | MOVEFLAG_ROOT))) return true; if (GetMover()->HasAuraType(SPELL_AURA_FEATHER_FALL)) return true; float ground_z = GetMover()->GetTerrain()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),MAX_HEIGHT); float floor_z = GetMover()->GetTerrain()->GetHeight(GetPlayer()->GetPositionX(),GetPlayer()->GetPositionY(),GetPlayer()->GetPositionZ()); float map_z = ((floor_z <= (INVALID_HEIGHT+5.0f)) ? ground_z : floor_z); if (map_z + m_currentConfig->checkFloatParam[0] > GetPlayer()->GetPositionZ() && map_z > (INVALID_HEIGHT + m_currentConfig->checkFloatParam[0] + 5.0f)) return true; if (m_currentDeltaZ > 0.0f) return true; char buffer[255]; sprintf(buffer," flying without fly auras on height %e but allowed %e", GetPlayer()->GetPositionZ(), map_z + m_currentConfig->checkFloatParam[0]); m_currentCheckResult.clear(); m_currentCheckResult.append(buffer); return false;}
开发者ID:Seehub,项目名称:mangos,代码行数:29,
示例2: SetActiveMover// Movement checksbool AntiCheat::CheckMovement(){ if (!GetPlayer()->IsSelfMover() && isActiveMover()) { SetActiveMover(false); m_currentMover = GetPlayer()->GetMover(); m_MovedLen = 0.0f; SetImmune(ANTICHEAT_DEFAULT_DELTA); } else if (GetPlayer()->IsSelfMover() && !isActiveMover()) { SetActiveMover(true); m_currentMover = ((Unit*)GetPlayer()); m_MovedLen = 0.0f; SetImmune(ANTICHEAT_DEFAULT_DELTA); } if (GetPlayer()->IsBeingTeleported()) SetImmune(ANTICHEAT_DEFAULT_DELTA); SetLastLiveState(GetPlayer()->getDeathState()); float delta_x = GetMover()->GetPositionX() - m_currentmovementInfo->GetPos()->x; float delta_y = GetMover()->GetPositionY() - m_currentmovementInfo->GetPos()->y; m_currentDeltaZ = GetMover()->GetPositionZ() - m_currentmovementInfo->GetPos()->z; m_currentDelta = sqrt(delta_x * delta_x + delta_y * delta_y); m_MovedLen += m_currentDelta; return true;}
开发者ID:Seehub,项目名称:mangos,代码行数:33,
示例3: ifbool AntiCheat::CheckSpeed(){ float speedRate = 1.0f; int serverDelta = WorldTimer::getMSTimeDiff(m_oldCheckTime[CHECK_MOVEMENT_SPEED],WorldTimer::getMSTime()); if (m_currentTimeSkipped > 0 && (float)m_currentTimeSkipped < serverDelta) { serverDelta += m_currentTimeSkipped; m_currentTimeSkipped = 0; } else if (m_currentTimeSkipped > 0 && (float)m_currentTimeSkipped > serverDelta) { m_currentTimeSkipped = 0; return true; } uint32 clientTime = m_currentmovementInfo->time; int clientDelta = clientTime - m_lastClientTime; m_lastClientTime = clientTime; float delta_t = float(std::max(clientDelta,serverDelta)); float moveSpeed = m_MovedLen / delta_t; m_MovedLen = 0.0f; std::string mode; if (m_currentmovementInfo->GetMovementFlags() & MOVEFLAG_FLYING) { speedRate = GetMover()->GetSpeed(MOVE_FLIGHT); mode = "MOVE_FLIGHT"; } else if (m_currentmovementInfo->GetMovementFlags() & MOVEFLAG_SWIMMING) { speedRate = GetMover()->GetSpeed(MOVE_SWIM); mode = "MOVE_SWIM"; } else if (m_currentmovementInfo->GetMovementFlags() & MOVEFLAG_WALK_MODE) { speedRate = GetMover()->GetSpeed(MOVE_WALK); mode = "MOVE_WALK"; } else { speedRate = GetMover()->GetSpeed(MOVE_RUN); mode = "MOVE_RUN"; } if ( moveSpeed / speedRate <= m_currentConfig->checkFloatParam[0] ) return true; char buffer[255]; sprintf(buffer," Speed is %f but allowed %f Mode is %s, opcode is %s, client delta is %d, server delta is %d", moveSpeed / speedRate, m_currentConfig->checkFloatParam[0],mode.c_str(), LookupOpcodeName(m_currentOpcode), clientDelta, serverDelta); m_currentCheckResult.clear(); m_currentCheckResult.append(buffer); return false;}
开发者ID:Seehub,项目名称:mangos,代码行数:59,
示例4: HideActor/** * Set actor hidden status to true. * For a moving actor, actually hide it. * @param ano Actor Id */void HideActor(CORO_PARAM, int ano) { PMOVER pMover; assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // illegal actor CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); if (TinselV2) { actorInfo[ano - 1].bHidden = true; // Send event to tagged actors // (this is duplicated in HideMover()) if (IsTaggedActor(ano)) { CORO_INVOKE_ARGS(ActorEvent, (CORO_SUBCTX, ano, HIDEEVENT, true, 0)); // It may be pointed to SetActorPointedTo(ano, false); SetActorTagWanted(ano, false, false, 0); } } // Get moving actor involved pMover = GetMover(ano); if (pMover) HideMover(pMover, 0); else if (!TinselV2) actorInfo[ano - 1].bHidden = true; CORO_END_CODE;}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:38,
示例5: storeActorReel/** * More properly should be called: * 'store_actor_reel_and/or_film_and/or_object()' */void storeActorReel(int ano, const FREEL *reel, SCNHANDLE hFilm, OBJECT *pobj, int reelnum, int x, int y) { PMOVER pActor; assert(ano > 0 && ano <= NumActors); // illegal actor number pActor = GetMover(ano); // Only store the reel and film for a moving actor if NOT called from MoverProcess() // (MoverProcess() calls with reel=film=NULL, pobj not NULL) if (!pActor || !(reel == NULL && hFilm == 0 && pobj != NULL)) { actorInfo[ano - 1].presReel = reel; // Store reel actorInfo[ano - 1].presRnum = reelnum; // Store reel number actorInfo[ano - 1].presFilm = hFilm; // Store film actorInfo[ano - 1].presPlayX = x; actorInfo[ano - 1].presPlayY = y; } // Only store the object for a moving actor if called from MoverProcess() if (!pActor) { actorInfo[ano - 1].presObj = pobj; // Store object } else if (reel == NULL && hFilm == 0 && pobj != NULL) { actorInfo[ano - 1].presObj = pobj; // Store object }}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:29,
示例6: NextTaggedActor/** * Called from TagProcess, NextTaggedActor() is * called repeatedly until the caller gets fed up or * there are no more tagged actors to look at. */int NextTaggedActor(int previous) { PMOVER pMover; // Convert actor number to index if (!previous) previous = -1; else previous = TaggedActorIndex(previous); while (++previous < numTaggedActors) { pMover = GetMover(taggedActors[previous].id); // No tag on lead actor while he's moving if ((taggedActors[previous].id) == GetLeadId() && MoverMoving(pMover)) { taggedActors[previous].tagFlags &= ~(POINTING | TAGWANTED); continue; } // Not if the actor doesn't exist at the moment if (pMover && !MoverIs(pMover)) continue; if (!(pMover ? MoverHidden(pMover) : ActorHidden(taggedActors[previous].id))) { return taggedActors[previous].id; } } return 0;}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:34,
示例7: if// Transport checksbool AntiCheat::CheckOnTransport(){ if (GetMover()->HasAura(56266)) return true; // transports size limited // (also received at zeppelin/lift leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) if ( m_currentmovementInfo->GetTransportPos()->x < m_currentConfig->checkFloatParam[1] && m_currentmovementInfo->GetTransportPos()->y < m_currentConfig->checkFloatParam[1] && m_currentmovementInfo->GetTransportPos()->z < 2.0f * m_currentConfig->checkFloatParam[1]) return true; float trans_rad = sqrt(m_currentmovementInfo->GetTransportPos()->x * m_currentmovementInfo->GetTransportPos()->x + m_currentmovementInfo->GetTransportPos()->y * m_currentmovementInfo->GetTransportPos()->y + m_currentmovementInfo->GetTransportPos()->z * m_currentmovementInfo->GetTransportPos()->z); if (trans_rad < + m_currentConfig->checkFloatParam[0]) return true; char buffer[255]; sprintf(buffer," Transport radius = %f, opcode = %s, on-transport coordinates %f, %f, %f ", trans_rad, LookupOpcodeName(m_currentOpcode), m_currentmovementInfo->GetTransportPos()->x, m_currentmovementInfo->GetTransportPos()->y, m_currentmovementInfo->GetTransportPos()->z); m_currentCheckResult.clear(); m_currentCheckResult.append(buffer); return false;}
开发者ID:sergeev,项目名称:mangos4,代码行数:29,
示例8: ScrollFocus/** * Change which actor the camera is following. */void ScrollFocus(int ano) { if (g_scrollActor != ano) { g_oldx = g_oldy = 0; g_scrollActor = ano; g_pScrollMover = ano ? GetMover(g_scrollActor) : NULL; }}
开发者ID:AReim1982,项目名称:scummvm,代码行数:11,
|