mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
fix lego club teleport (#1731)
Tested that the lego club teleport and starbase 3001 teleports work now both before and after you visit nexus tower
This commit is contained in:
@@ -10,49 +10,38 @@ void NsLegoClubDoor::OnStartup(Entity* self) {
|
||||
self->SetVar(u"teleportString", m_TeleportString);
|
||||
self->SetVar(u"spawnPoint", m_SpawnPoint);
|
||||
|
||||
args = {};
|
||||
teleportArgs.Reset();
|
||||
|
||||
args.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
||||
args.Insert("strIdentifier", "choiceDoor");
|
||||
args.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
||||
teleportArgs.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
||||
teleportArgs.Insert("strIdentifier", "choiceDoor");
|
||||
teleportArgs.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
||||
|
||||
AMFArrayValue* choiceOptions = args.InsertArray("options");
|
||||
auto& choiceOptions = *teleportArgs.InsertArray("options");
|
||||
|
||||
{
|
||||
AMFArrayValue* nsArgs = choiceOptions->PushArray();
|
||||
auto& nsArgs = *choiceOptions.PushArray();
|
||||
|
||||
nsArgs->Insert("image", "textures/ui/zone_thumnails/Nimbus_Station.dds");
|
||||
nsArgs->Insert("caption", "%[UI_CHOICE_NS]");
|
||||
nsArgs->Insert("identifier", "zoneID_1200");
|
||||
nsArgs->Insert("tooltipText", "%[UI_CHOICE_NS_HOVER]");
|
||||
nsArgs.Insert("image", "textures/ui/zone_thumnails/Nimbus_Station.dds");
|
||||
nsArgs.Insert("caption", "%[UI_CHOICE_NS]");
|
||||
nsArgs.Insert("identifier", "zoneID_1200");
|
||||
nsArgs.Insert("tooltipText", "%[UI_CHOICE_NS_HOVER]");
|
||||
}
|
||||
|
||||
{
|
||||
AMFArrayValue* ntArgs = choiceOptions->PushArray();
|
||||
auto& ntArgs = *choiceOptions.PushArray();
|
||||
|
||||
ntArgs->Insert("image", "textures/ui/zone_thumnails/Nexus_Tower.dds");
|
||||
ntArgs->Insert("caption", "%[UI_CHOICE_NT]");
|
||||
ntArgs->Insert("identifier", "zoneID_1900");
|
||||
ntArgs->Insert("tooltipText", "%[UI_CHOICE_NT_HOVER]");
|
||||
ntArgs.Insert("image", "textures/ui/zone_thumnails/Nexus_Tower.dds");
|
||||
ntArgs.Insert("caption", "%[UI_CHOICE_NT]");
|
||||
ntArgs.Insert("identifier", "zoneID_1900");
|
||||
ntArgs.Insert("tooltipText", "%[UI_CHOICE_NT_HOVER]");
|
||||
}
|
||||
|
||||
options = choiceOptions;
|
||||
}
|
||||
|
||||
void NsLegoClubDoor::OnUse(Entity* self, Entity* user) {
|
||||
auto* player = user;
|
||||
|
||||
if (CheckChoice(self, player)) {
|
||||
AMFArrayValue multiArgs;
|
||||
|
||||
multiArgs.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
||||
multiArgs.Insert("strIdentifier", "choiceDoor");
|
||||
multiArgs.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
||||
multiArgs.Insert("options", static_cast<AMFBaseValue*>(options));
|
||||
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", multiArgs);
|
||||
|
||||
multiArgs.Remove("options", false); // We do not want the local amf to delete the options!
|
||||
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", teleportArgs);
|
||||
} else if (self->GetVar<int32_t>(u"currentZone") != m_ChoiceZoneID) {
|
||||
AMFArrayValue multiArgs;
|
||||
multiArgs.Insert("state", "Lobby");
|
||||
|
Reference in New Issue
Block a user