fix: orient player correctly when using pirate mast in FV (#1087)

* fix: frient player correctly when using pirate mast in FV

* only get mast name once
This commit is contained in:
Aaron Kimbrell 2023-05-13 09:31:13 -05:00 committed by GitHub
parent 739eae5244
commit 1af70161eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,10 +43,13 @@ void MastTeleport::OnTimerDone(Entity* self, std::string timerName) {
GameMessages::SendTeleport(playerId, position, rotation, player->GetSystemAddress(), true);
// Hacky fix for odd rotations
if (self->GetVar<std::u16string>(u"MastName") != u"Jail") {
auto mastName = self->GetVar<std::u16string>(u"MastName");
if (mastName == u"Elephant") {
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 140.0f, player->GetSystemAddress());
} else {
} else if (mastName == u"Jail") {
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 100.0f, player->GetSystemAddress());
} else if (mastName == u""){
GameMessages::SendOrientToAngle(playerId, true, (M_PI / 180) * 203.0f, player->GetSystemAddress());
}
const auto cinematic = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"Cinematic"));