From f75cdb079d8520ef30951bd4adf178268cf8b2f9 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Thu, 11 Mar 2021 13:58:26 -0600 Subject: [PATCH] Fixed some other bugs --- Client/src/main/kotlin/org/rs09/Discord.kt | 7 +++++-- .../core/game/content/dialogue/SigmundDialogue.java | 9 ++++----- .../quest/free/shieldofarrav/KingRoaldArravDialogue.kt | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Client/src/main/kotlin/org/rs09/Discord.kt b/Client/src/main/kotlin/org/rs09/Discord.kt index 87bf5d6ea..c9dace69f 100644 --- a/Client/src/main/kotlin/org/rs09/Discord.kt +++ b/Client/src/main/kotlin/org/rs09/Discord.kt @@ -15,9 +15,10 @@ object Discord { var initialized = false @JvmStatic + //Removed support for Linux due to the outlined issue on line 37. TODO: Revisit this when the RPC library updates. There's a PR there that *should* fix it. fun checkInitializable() : Boolean{ val OS = System.getProperty("os.name") - if(OS.toLowerCase().startsWith("windows") || OS.toLowerCase().contains("nux")){ + if(OS.toLowerCase().startsWith("windows")){ val arch = System.getProperty("os.arch") return arch != "aarch64" && !initialized } @@ -33,7 +34,9 @@ object Discord { DiscordRPC.discordShutdown() }.build() - DiscordRPC.discordInitialize(APP_ID,handlers,true) + //On Linux, when the discord library initializes, it can crash any other client loading the same library. + //Not sure what causes this, likely a JVM bug to be honest. + DiscordRPC.discordInitialize(APP_ID, handlers, true) initialized = true } diff --git a/Server/src/main/java/Server/core/game/content/dialogue/SigmundDialogue.java b/Server/src/main/java/Server/core/game/content/dialogue/SigmundDialogue.java index 3fd1639d6..5f1e0cf5e 100644 --- a/Server/src/main/java/Server/core/game/content/dialogue/SigmundDialogue.java +++ b/Server/src/main/java/Server/core/game/content/dialogue/SigmundDialogue.java @@ -4,6 +4,8 @@ import core.game.node.entity.npc.NPC; import core.plugin.Initializable; import core.game.node.entity.player.Player; +import static core.tools.DialogueConstKt.END_DIALOGUE; + /** * Handles the SigmundDialogue dialogue. * @author 'Vexia @@ -101,16 +103,13 @@ public class SigmundDialogue extends DialoguePlugin { break; case 31: npc("You should ask other people around the town if they","saw anything."); - stage++; + stage = END_DIALOGUE; player.getQuestRepository().getQuest("Lost Tribe").start(player); player.setAttribute("/save:tlt-witness", TLTNPCS[0]); break; - case 32: - end(); - break; case 34: player("No..."); - stage = 32; + stage = END_DIALOGUE; break; } return true; diff --git a/Server/src/main/java/Server/core/game/content/quest/free/shieldofarrav/KingRoaldArravDialogue.kt b/Server/src/main/java/Server/core/game/content/quest/free/shieldofarrav/KingRoaldArravDialogue.kt index 6a27d784e..1b2181b32 100644 --- a/Server/src/main/java/Server/core/game/content/quest/free/shieldofarrav/KingRoaldArravDialogue.kt +++ b/Server/src/main/java/Server/core/game/content/quest/free/shieldofarrav/KingRoaldArravDialogue.kt @@ -38,14 +38,14 @@ class KingRoaldArravDialogue() : DialogueFile() { 2 -> npc("My goodness! This claim is for the reward offered by", "my father many years ago!").also { stage++ } 3 -> npc("I never thought I would live to see the day when", "someone came forward to claim this reward!").also { stage++ } 4 -> npc("I heard that you found half the shield, so I will give", "you half of the bounty. That comes to exactly 600 gp!").also { stage++ } - 5 -> interpreter!!.sendItemMessage(CERTIFICATE.id, "You hand over a certificate. The king gives you 600 gp.").also { stage = END_DIALOGUE } - END_DIALOGUE -> { + 5 -> { + interpreter!!.sendItemMessage(CERTIFICATE.id, "You hand over a certificate. The king gives you 600 gp.") if (player!!.inventory.remove(CERTIFICATE)) { if (!player!!.inventory.add(Item(995, 600))) { GroundItemManager.create(Item(995, 600), player) } player!!.questRepository.getQuest("Shield of Arrav").finish(player) - end() + stage = END_DIALOGUE } } }