format codebase

This commit is contained in:
aronwk-aaron
2022-07-28 08:39:57 -05:00
parent 4f7aa11067
commit 19e77a38d8
881 changed files with 34700 additions and 38689 deletions

View File

@@ -5,8 +5,7 @@
#include "AMFFormat.h"
void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
if (self->GetVar<bool>(u"hasCustomText"))
{
if (self->GetVar<bool>(u"hasCustomText")) {
const auto& customText = self->GetVar<std::string>(u"customText");
{
@@ -20,7 +19,7 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "pushGameState", &args);
}
user->AddCallbackTimer(0.1f, [user, customText] () {
user->AddCallbackTimer(0.1f, [user, customText]() {
AMFArrayValue args;
auto* text = new AMFStringValue();
@@ -30,21 +29,20 @@ void StoryBoxInteractServer::OnUse(Entity* self, Entity* user) {
args.InsertValue("text", text);
GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "ToggleStoryBox", &args);
});
});
return;
}
const auto storyText = self->GetVarAsString(u"storyText");
int32_t boxFlag = self->GetVar<int32_t>(u"altFlagID");
if (boxFlag <= 0)
{
boxFlag = (10000 + Game::server->GetZoneID() +std::stoi(storyText.substr(storyText.length() - 2)));
if (boxFlag <= 0) {
boxFlag = (10000 + Game::server->GetZoneID() + std::stoi(storyText.substr(storyText.length() - 2)));
}
if (user->GetCharacter()->GetPlayerFlag(boxFlag) == false) {
user->GetCharacter()->SetPlayerFlag(boxFlag, true);
GameMessages::SendFireEventClientSide(self->GetObjectID(), user->GetSystemAddress(), u"achieve", LWOOBJID_EMPTY, 0, -1, LWOOBJID_EMPTY);
}
}
}