bool NDPlayer::canUnpackRidePet() { NDMapMgr& mgr = NDMapMgrObj; NDMapLayer * maplayer = mgr.getMapLayerOfScene(NDDirector::DefaultDirector()->GetScene(RUNTIME_CLASS(GameScene))); if (maplayer && IsInState(USERSTATE_FLY) && mgr.canFly()) { NDMapData *mapdata = maplayer->GetMapData(); if (!mapdata || !mapdata->getSwitchs() || int(mapdata->getSwitchs()->count()) == 0) { return true; } NDMapSwitch* mapswitch = (NDMapSwitch *)mapdata->getSwitchs()->objectAtIndex(0); if (!mapswitch) return true; // 不能自动寻路到切屏点 todo // CCPoint from = ccp(m_nServerCol*MAP_UNITSIZE+DISPLAY_POS_X_OFFSET, m_nServerRow*MAP_UNITSIZE+DISPLAY_POS_Y_OFFSET); //@del // CCPoint to = ccp(mapswitch->getX()*MAP_UNITSIZE+DISPLAY_POS_X_OFFSET, mapswitch->getY()*MAP_UNITSIZE+DISPLAY_POS_Y_OFFSET); CCPoint from = ConvertUtil::convertCellToDisplay( m_nServerCol, m_nServerRow ); CCPoint to = ConvertUtil::convertCellToDisplay( mapswitch->getX(), mapswitch->getY() ); return NDAutoPath::sharedAutoPath()->autoFindPath(from, to , maplayer, IsInState(USERSTATE_SPEED_UP) ? SpriteSpeedStep8 : SpriteSpeedStep4, false); } return true; }
void ASPlayerController::Suicide() { if (IsInState(NAME_Playing)) { ServerSuicide(); } }
void CTaxasPokerPeer::TryToLeaveRoom() { if ( IsInState(eRoomPeer_WaitCaculate) ) { GetPlayer()->SetState(CPlayer::ePlayerState_WillLeavingRoom) ; } else { CRoomPeer::TryToLeaveRoom(); } }
void AController::PawnPendingDestroy(APawn* inPawn) { if ( IsInState(NAME_Inactive) ) { UE_LOG(LogPath, Log, TEXT("PawnPendingDestroy while inactive %s"), *GetName()); } if ( inPawn != Pawn ) { return; } UnPossess(); ChangeState(NAME_Inactive); if (PlayerState == NULL) { Destroy(); } }
bool NDPlayer::isRoleCanMove() { return !IsInState(USERSTATE_BOOTH) && (isTeamLeader() || !isTeamMember()) && !m_bLocked; }