From c4135eac46ec025cf1b419856897eee9fae91d5b Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Mon, 26 Jun 2023 00:51:28 -0700 Subject: [PATCH 1/3] Revert playerflags functions to uint instead of int (#1130) Prevents issue with negative numbers resulting in bugs. --- dGame/Character.cpp | 4 ++-- dGame/Character.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dGame/Character.cpp b/dGame/Character.cpp index 319b9376..dc3e0a71 100644 --- a/dGame/Character.cpp +++ b/dGame/Character.cpp @@ -418,7 +418,7 @@ void Character::WriteToDatabase() { delete printer; } -void Character::SetPlayerFlag(const int32_t flagId, const bool value) { +void Character::SetPlayerFlag(const uint32_t flagId, const bool value) { // If the flag is already set, we don't have to recalculate it if (GetPlayerFlag(flagId) == value) return; @@ -465,7 +465,7 @@ void Character::SetPlayerFlag(const int32_t flagId, const bool value) { GameMessages::SendNotifyClientFlagChange(m_ObjectID, flagId, value, m_ParentUser->GetSystemAddress()); } -bool Character::GetPlayerFlag(const int32_t flagId) const { +bool Character::GetPlayerFlag(const uint32_t flagId) const { // Calculate the index first const auto flagIndex = uint32_t(std::floor(flagId / 64)); diff --git a/dGame/Character.h b/dGame/Character.h index 3759f206..79ce0c0c 100644 --- a/dGame/Character.h +++ b/dGame/Character.h @@ -415,14 +415,14 @@ public: * @param flagId the ID of the flag to set * @param value the value to set for the flag */ - void SetPlayerFlag(int32_t flagId, bool value); + void SetPlayerFlag(uint32_t flagId, bool value); /** * Gets the value for a certain character flag * @param flagId the ID of the flag to get a value for * @return the value of the flag given the ID (the default is false, obviously) */ - bool GetPlayerFlag(int32_t flagId) const; + bool GetPlayerFlag(uint32_t flagId) const; /** * Notifies the character that they're now muted From 5cc7479f293f928d59d63f2e787cf7ed0c0b5050 Mon Sep 17 00:00:00 2001 From: Raine <16182738+uwainium@users.noreply.github.com> Date: Sat, 1 Jul 2023 18:40:34 -0400 Subject: [PATCH 2/3] Update credits (#1133) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f51b5e2a..b7e2a101 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ This is a Work in Progress, but below are some quick links to documentaion for s ## Former Contributors * TheMachine * Matthew -* [Raine](https://github.com/Rainebannister) +* [Raine](https://github.com/uwainium) * Bricknave ## Special Thanks From 9375c36c7bd65f065da1253fbc1371aca9716d0a Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Mon, 3 Jul 2023 11:58:49 -0500 Subject: [PATCH 3/3] fix: remove hardcoded rotations now that vehicles orient correctly (#1132) --- dGame/dComponents/InventoryComponent.cpp | 12 +----------- dGame/dUtilities/SlashCommandHandler.cpp | 12 ------------ 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 626c7ee9..b0471736 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -995,17 +995,7 @@ void InventoryComponent::HandlePossession(Item* item) { // Check to see if the mount is a vehicle, if so, flip it auto* vehicleComponent = mount->GetComponent(); - if (vehicleComponent) { - auto angles = startRotation.GetEulerAngles(); - // Make it right side up - angles.x -= PI; - // Make it going in the direction of the player - angles.y -= PI; - startRotation = NiQuaternion::FromEulerAngles(angles); - mount->SetRotation(startRotation); - // We're pod racing now - characterComponent->SetIsRacing(true); - } + if (vehicleComponent) characterComponent->SetIsRacing(true); // Setup the destroyable stats auto* destroyableComponent = mount->GetComponent(); diff --git a/dGame/dUtilities/SlashCommandHandler.cpp b/dGame/dUtilities/SlashCommandHandler.cpp index b65bf723..47e0f0e4 100644 --- a/dGame/dUtilities/SlashCommandHandler.cpp +++ b/dGame/dUtilities/SlashCommandHandler.cpp @@ -1267,18 +1267,6 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit return; } - auto vehiclePhysicsComponent = newEntity->GetComponent(); - if (vehiclePhysicsComponent) { - auto newRot = newEntity->GetRotation(); - auto angles = newRot.GetEulerAngles(); - // make it right side up - angles.x -= PI; - // make it going in the direction of the player - angles.y -= PI; - newRot = NiQuaternion::FromEulerAngles(angles); - newEntity->SetRotation(newRot); - } - EntityManager::Instance()->ConstructEntity(newEntity); }