本文整理汇总了C++中TransportInfo::GetTransportGuid方法的典型用法代码示例。如果您正苦于以下问题:C++ TransportInfo::GetTransportGuid方法的具体用法?C++ TransportInfo::GetTransportGuid怎么用?C++ TransportInfo::GetTransportGuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransportInfo
的用法示例。
在下文中一共展示了TransportInfo::GetTransportGuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Stop
void MoveSplineInit::Stop()
{
MoveSpline& move_spline = *unit.movespline;
// No need to stop if we are not moving
if (move_spline.Finalized())
return;
TransportInfo* transportInfo = unit.GetTransportInfo();
Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetOrientation());
// If boarded use current local position
if (transportInfo)
transportInfo->GetLocalPosition(real_position.x, real_position.y, real_position.z, real_position.orientation);
// there is a big chance that current position is unknown if current state is not finalized, need compute it
// this also allows calculate spline position and update map position in much greater intervals
if (!move_spline.Finalized() && !transportInfo)
real_position = move_spline.ComputePosition();
if (args.path.empty())
{
// should i do the things that user should do?
MoveTo(real_position);
}
// current first vertex
args.path[0] = real_position;
args.flags = MoveSplineFlag::Done;
unit.m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEFLAG_FORWARD | MOVEFLAG_SPLINE_ENABLED));
move_spline.Initialize(args);
WorldPacket data(SMSG_MONSTER_MOVE, 64);
data << unit.GetPackGUID();
if (transportInfo)
{
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
data << transportInfo->GetTransportGuid().WriteAsPacked();
}
data << real_position.x << real_position.y << real_position.z;
data << move_spline.GetId();
data << uint8(MonsterMoveStop);
unit.SendMessageToSet(&data, true);
}
示例2: Launch
int32 MoveSplineInit::Launch()
{
MoveSpline& move_spline = *unit.movespline;
TransportInfo* transportInfo = unit.GetTransportInfo();
Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZ(), unit.GetOrientation());
// If boarded use current local position
if (transportInfo)
transportInfo->GetLocalPosition(real_position.x, real_position.y, real_position.z, real_position.orientation);
// there is a big chane that current position is unknown if current state is not finalized, need compute it
// this also allows calculate spline position and update map position in much greater intervals
if (!move_spline.Finalized() && !transportInfo)
real_position = move_spline.ComputePosition();
if (args.path.empty())
{
// should i do the things that user should do?
MoveTo(real_position);
}
// corrent first vertex
args.path[0] = real_position;
args.initialOrientation = real_position.orientation;
uint32 moveFlags = unit.m_movementInfo.GetMovementFlags();
if (args.flags.walkmode)
moveFlags |= MOVEFLAG_WALK_MODE;
else
moveFlags &= ~MOVEFLAG_WALK_MODE;
moveFlags |= (MOVEFLAG_SPLINE_ENABLED | MOVEFLAG_FORWARD);
if (fabs(args.velocity) < M_NULL_F)
args.velocity = unit.GetSpeed(SelectSpeedType(moveFlags));
if (!args.Validate(&unit))
return 0;
if (moveFlags & MOVEFLAG_ROOT)
moveFlags &= ~MOVEFLAG_MASK_MOVING;
unit.m_movementInfo.SetMovementFlags((MovementFlags)moveFlags);
move_spline.Initialize(args);
WorldPacket data(SMSG_MONSTER_MOVE, 64);
data << unit.GetPackGUID();
if (transportInfo)
{
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
data << transportInfo->GetTransportGuid().WriteAsPacked();
data << int8(transportInfo->GetTransportSeat());
}
PacketBuilder::WriteMonsterMove(move_spline, data);
unit.SendMessageToSet(&data, true);
return move_spline.Duration();
}