本文整理汇总了C++中GetMover函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMover函数的具体用法?C++ GetMover怎么用?C++ GetMover使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMover函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMover
bool 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;
}
示例2: SetActiveMover
// Movement checks
bool 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;
}
示例3: if
bool 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;
}
示例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;
}
示例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
}
}
示例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;
}
示例7: if
// Transport checks
bool 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;
}
示例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;
}
}
示例9: GetMover
// AI가 제어할 수 있는가?
BOOL CAIMonster2::IsControllable()
{
CMover* pMover = GetMover();
// 죽었을 경우 or 데미지 플라이 상태?
if( pMover->IsDie() || (pMover->m_pActMover->GetState() & OBJSTA_DMG_FLY_ALL) )
return FALSE;
return TRUE;
}
示例10: GetMover
bool AntiCheat::CheckTp2Plane()
{
if (m_currentmovementInfo->GetPos()->z > m_currentConfig->checkFloatParam[0] || m_currentmovementInfo->GetPos()->z < -m_currentConfig->checkFloatParam[0])
return true;
if (GetMover()->HasAuraType(SPELL_AURA_GHOST)
|| GetMover()->HasAuraType(SPELL_AURA_WATER_WALK)
|| GetMover()->HasAura(60068) //Path of Frost
|| GetMover()->HasAura(61081) //dummy Path of Frost(60068)
|| GetMover()->HasAura(11319) //SPELL_AURA_WATER_WALK, Spell Water Walking
|| GetMover()->HasAura(27986) // SPELL_AURA_FEATHER_FALL and SPELL_AURA_HOVER and SPELL_EFFECT_APPLY_AURA
)
return true;
float plane_z = 0.0f;
plane_z = GetMover()->GetMap()->GetHeight(GetPlayer()->GetPhaseMask(),m_currentmovementInfo->GetPos()->x, m_currentmovementInfo->GetPos()->y, MAX_HEIGHT) - m_currentmovementInfo->GetPos()->z;
plane_z = (plane_z < -500.0f) ? 0 : plane_z; //check holes in heigth map
if(plane_z < m_currentConfig->checkFloatParam[1] && plane_z > -m_currentConfig->checkFloatParam[1])
return true;
char buffer[255];
sprintf(buffer," Plane Z = %e, player Z = %e, opcode %s",
plane_z, GetPlayer()->GetPositionZ(), LookupOpcodeName(m_currentOpcode));
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}
示例11: defined
DWORD CActionMover::_ProcessMsgDmg( DWORD dwMsg, CMover* pAttacker, DWORD dwAtkFlags, int nParam, BOOL bTarget, int nReflect )
{
#if defined(__WORLDSERVER)
CAttackArbiter arbiter( dwMsg, pAttacker, GetMover(), dwAtkFlags, nParam, bTarget, nReflect );
return arbiter.OnDamageMsgW();
#elif defined(__CLIENT)
return OnDamageMsgC( dwMsg, pAttacker, dwAtkFlags, nParam );
#else
return 0;
#endif
}
示例12: unHideMovingActor
/**
* Unhide an actor if it's a moving actor.
* @param ano Actor Id
*/
void unHideMovingActor(int ano) {
PMOVER pActor;
assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // illegal actor
// Get moving actor involved
pActor = GetMover(ano);
assert(pActor); // not a moving actor
UnHideMover(pActor);
}
示例13: DisableActor
/**
* Kill actors.
* @param ano Actor Id
*/
void DisableActor(int ano) {
PMOVER pActor;
assert(ano > 0 && ano <= NumActors); // illegal actor number
actorInfo[ano - 1].bAlive = false; // Record as dead
actorInfo[ano - 1].x = actorInfo[ano - 1].y = 0;
// Kill off moving actor properly
pActor = GetMover(ano);
if (pActor)
KillMover(pActor);
}
示例14: GetActorPos
void GetActorPos(int ano, int *x, int *y) {
PMOVER pActor;
assert((ano > 0 && ano <= NumActors) || ano == LEAD_ACTOR); // unknown actor
pActor = GetMover(ano);
if (pActor)
GetMoverPosition(pActor, x, y);
else {
*x = actorInfo[ano - 1].x;
*y = actorInfo[ano - 1].y;
}
}
示例15: CheckAirJump
bool AntiCheat::CheckAirJump()
{
if (m_currentOpcode != CMSG_MOVE_JUMP)
return true;
if (!m_currentmovementInfo->HasMovementFlag(MOVEFLAG_FALLING) || !GetMover()->m_movementInfo.HasMovementFlag(MOVEFLAG_FALLING))
return true;
char buffer[255];
sprintf(buffer," player Z = %f, opcode %s", GetPlayer()->GetPositionZ(), LookupOpcodeName(m_currentOpcode));
m_currentCheckResult.clear();
m_currentCheckResult.append(buffer);
return false;
}