mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Map Party Quests to Quest ID for better Packet Handling
Prevents Loop from being run every time Party Quest is set
This commit is contained in:
1 parent
faf9e61258
commit
1c29fd66c4
5 files changed
+40
-37
No files matched your search
@@ -211,22 +211,20 @@ public class PacketHandlerServer{
|
||||
return;
|
||||
}
|
||||
|
||||
String questCategory = Server.readString(buffer);
|
||||
String questName = Server.readString(buffer);
|
||||
int questID = buffer.readInt();
|
||||
party.setQuest(null);
|
||||
for (Quest quest : QuestController.Instance.quests.values()) {
|
||||
if (quest.partyOptions.allowParty && quest.getCategory().getName().equals(questCategory) && quest.getName().equals(questName)) {
|
||||
|
||||
if(playerData.questData.hasActiveQuest(quest.getId())){
|
||||
QuestData questdata = new QuestData(quest);
|
||||
playerData.questData.activeQuests.put(quest.getId(), questdata);
|
||||
if(questID != -1){
|
||||
Quest foundQuest = QuestController.Instance.quests.get(questID);
|
||||
if(foundQuest != null){
|
||||
if (foundQuest.partyOptions.allowParty) {
|
||||
if(playerData.questData.hasActiveQuest(questID)){
|
||||
QuestData questdata = new QuestData(foundQuest);
|
||||
playerData.questData.activeQuests.put(questID, questdata);
|
||||
}
|
||||
party.setQuest(foundQuest);
|
||||
}
|
||||
|
||||
party.setQuest(quest);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Server.sendData(player, EnumPacketClient.PARTY_DATA, party.writeToNBT());
|
||||
PartyController.Instance().pingPartyUpdate(party);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user