Fixed some other bugs

This commit is contained in:
Ceikry 2021-03-11 13:58:26 -06:00
parent bef8478954
commit f75cdb079d
3 changed files with 12 additions and 10 deletions

View file

@ -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
}

View file

@ -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;

View file

@ -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
}
}
}