forked from teamnwah/openmw-tes3coop
Use new SendPos() method in server scripts to send position packets
This commit is contained in:
parent
e0c88150c3
commit
5b39916894
2 changed files with 15 additions and 7 deletions
|
@ -95,8 +95,6 @@ void TranslocationFunctions::SetPos(unsigned short pid, double x, double y, doub
|
||||||
player->Position()->pos[0] = x;
|
player->Position()->pos[0] = x;
|
||||||
player->Position()->pos[1] = y;
|
player->Position()->pos[1] = y;
|
||||||
player->Position()->pos[2] = z;
|
player->Position()->pos[2] = z;
|
||||||
|
|
||||||
mwmp::Networking::Get().GetPlayerController()->GetPacket(ID_GAME_POS)->Send(player, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslocationFunctions::SetAngle(unsigned short pid, double x, double y, double z) noexcept
|
void TranslocationFunctions::SetAngle(unsigned short pid, double x, double y, double z) noexcept
|
||||||
|
@ -107,8 +105,6 @@ void TranslocationFunctions::SetAngle(unsigned short pid, double x, double y, do
|
||||||
player->Position()->rot[0] = x;
|
player->Position()->rot[0] = x;
|
||||||
player->Position()->rot[1] = y;
|
player->Position()->rot[1] = y;
|
||||||
player->Position()->rot[2] = z;
|
player->Position()->rot[2] = z;
|
||||||
|
|
||||||
mwmp::Networking::Get().GetPlayerController()->GetPacket(ID_GAME_POS)->Send(player, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TranslocationFunctions::GetCell(unsigned short pid) noexcept
|
const char* TranslocationFunctions::GetCell(unsigned short pid) noexcept
|
||||||
|
@ -186,3 +182,11 @@ bool TranslocationFunctions::IsInExterior(unsigned short pid) noexcept
|
||||||
return player->GetCell()->isExterior();
|
return player->GetCell()->isExterior();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TranslocationFunctions::SendPos(unsigned short pid) noexcept
|
||||||
|
{
|
||||||
|
Player *player;
|
||||||
|
GET_PLAYER(pid, player, );
|
||||||
|
|
||||||
|
mwmp::Networking::Get().GetPlayerController()->GetPacket(ID_GAME_POS)->Send(player, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,13 @@
|
||||||
{"GetPosX", TranslocationFunctions::GetPosX},\
|
{"GetPosX", TranslocationFunctions::GetPosX},\
|
||||||
{"GetPosY", TranslocationFunctions::GetPosY},\
|
{"GetPosY", TranslocationFunctions::GetPosY},\
|
||||||
{"GetPosZ", TranslocationFunctions::GetPosZ},\
|
{"GetPosZ", TranslocationFunctions::GetPosZ},\
|
||||||
{"SetPos", TranslocationFunctions::SetPos},\
|
|
||||||
\
|
\
|
||||||
{"GetAngle", TranslocationFunctions::GetAngle},\
|
{"GetAngle", TranslocationFunctions::GetAngle},\
|
||||||
{"GetAngleX", TranslocationFunctions::GetAngleX},\
|
{"GetAngleX", TranslocationFunctions::GetAngleX},\
|
||||||
{"GetAngleY", TranslocationFunctions::GetAngleY},\
|
{"GetAngleY", TranslocationFunctions::GetAngleY},\
|
||||||
{"GetAngleZ", TranslocationFunctions::GetAngleZ},\
|
{"GetAngleZ", TranslocationFunctions::GetAngleZ},\
|
||||||
|
\
|
||||||
|
{"SetPos", TranslocationFunctions::SetPos},\
|
||||||
{"SetAngle", TranslocationFunctions::SetAngle},\
|
{"SetAngle", TranslocationFunctions::SetAngle},\
|
||||||
\
|
\
|
||||||
{"GetCell", TranslocationFunctions::GetCell},\
|
{"GetCell", TranslocationFunctions::GetCell},\
|
||||||
|
@ -25,7 +26,9 @@
|
||||||
{"SetExterior", TranslocationFunctions::SetExterior},\
|
{"SetExterior", TranslocationFunctions::SetExterior},\
|
||||||
{"GetExteriorX", TranslocationFunctions::GetExteriorX},\
|
{"GetExteriorX", TranslocationFunctions::GetExteriorX},\
|
||||||
{"GetExteriorY", TranslocationFunctions::GetExteriorY},\
|
{"GetExteriorY", TranslocationFunctions::GetExteriorY},\
|
||||||
{"IsInExterior", TranslocationFunctions::IsInExterior}
|
{"IsInExterior", TranslocationFunctions::IsInExterior}\
|
||||||
|
\
|
||||||
|
{"SendPos", TranslocationFunctions::SendPosition}
|
||||||
|
|
||||||
|
|
||||||
class TranslocationFunctions
|
class TranslocationFunctions
|
||||||
|
@ -49,8 +52,9 @@ public:
|
||||||
static void SetExterior(unsigned short pid, int x, int y) noexcept;
|
static void SetExterior(unsigned short pid, int x, int y) noexcept;
|
||||||
static int GetExteriorX(unsigned short pid) noexcept;
|
static int GetExteriorX(unsigned short pid) noexcept;
|
||||||
static int GetExteriorY(unsigned short pid) noexcept;
|
static int GetExteriorY(unsigned short pid) noexcept;
|
||||||
|
|
||||||
static bool IsInExterior(unsigned short pid) noexcept;
|
static bool IsInExterior(unsigned short pid) noexcept;
|
||||||
|
|
||||||
|
static void SendPos(unsigned short pid) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //OPENMW_TRANSLOCATIONS_HPP
|
#endif //OPENMW_TRANSLOCATIONS_HPP
|
||||||
|
|
Loading…
Reference in a new issue