Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
a227b44c
Commit
a227b44c
authored
May 13, 2022
by
Melledy
Browse files
Fixed quests not finishing their questline
parent
f4770cf2
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/def/QuestData.java
View file @
a227b44c
...
@@ -15,6 +15,9 @@ public class QuestData extends GameResource {
...
@@ -15,6 +15,9 @@ public class QuestData extends GameResource {
private
int
Order
;
private
int
Order
;
private
long
DescTextMapHash
;
private
long
DescTextMapHash
;
private
boolean
FinishParent
;
private
boolean
IsRewind
;
private
LogicType
AcceptCondComb
;
private
LogicType
AcceptCondComb
;
private
QuestCondition
[]
acceptConditons
;
private
QuestCondition
[]
acceptConditons
;
private
LogicType
FinishCondComb
;
private
LogicType
FinishCondComb
;
...
@@ -45,6 +48,14 @@ public class QuestData extends GameResource {
...
@@ -45,6 +48,14 @@ public class QuestData extends GameResource {
return
DescTextMapHash
;
return
DescTextMapHash
;
}
}
public
boolean
finishParent
()
{
return
FinishParent
;
}
public
boolean
isRewind
()
{
return
IsRewind
;
}
public
LogicType
getAcceptCondComb
()
{
public
LogicType
getAcceptCondComb
()
{
return
AcceptCondComb
;
return
AcceptCondComb
;
}
}
...
...
src/main/java/emu/grasscutter/game/quest/GameMainQuest.java
View file @
a227b44c
...
@@ -91,6 +91,7 @@ public class GameMainQuest {
...
@@ -91,6 +91,7 @@ public class GameMainQuest {
this
.
isFinished
=
true
;
this
.
isFinished
=
true
;
this
.
state
=
ParentQuestState
.
PARENT_QUEST_STATE_FINISHED
;
this
.
state
=
ParentQuestState
.
PARENT_QUEST_STATE_FINISHED
;
this
.
getOwner
().
getSession
().
send
(
new
PacketFinishedParentQuestUpdateNotify
(
this
));
this
.
getOwner
().
getSession
().
send
(
new
PacketFinishedParentQuestUpdateNotify
(
this
));
this
.
save
();
}
}
public
void
save
()
{
public
void
save
()
{
...
...
src/main/java/emu/grasscutter/game/quest/GameQuest.java
View file @
a227b44c
...
@@ -143,21 +143,28 @@ public class GameQuest {
...
@@ -143,21 +143,28 @@ public class GameQuest {
this
.
getOwner
().
getSession
().
send
(
new
PacketQuestProgressUpdateNotify
(
this
));
this
.
getOwner
().
getSession
().
send
(
new
PacketQuestProgressUpdateNotify
(
this
));
this
.
getOwner
().
getSession
().
send
(
new
PacketQuestListUpdateNotify
(
this
));
this
.
getOwner
().
getSession
().
send
(
new
PacketQuestListUpdateNotify
(
this
));
this
.
save
();
this
.
tryAcceptQuestLine
();
if
(
this
.
getData
().
finishParent
())
{
// This quest finishes the questline - the main quest will also save the quest to db so we dont have to call save() here
this
.
getMainQuest
().
finish
();
}
else
{
// Try and accept other quests if possible
this
.
tryAcceptQuestLine
();
this
.
save
();
}
}
}
public
boolean
tryAcceptQuestLine
()
{
public
boolean
tryAcceptQuestLine
()
{
try
{
try
{
MainQuestData
questConfig
=
GameData
.
getMainQuestDataMap
().
get
(
this
.
getMainQuestId
());
MainQuestData
questConfig
=
GameData
.
getMainQuestDataMap
().
get
(
this
.
getMainQuestId
());
for
(
SubQuestData
subQuest
:
questConfig
.
getSubQuests
())
{
for
(
SubQuestData
subQuest
:
questConfig
.
getSubQuests
())
{
GameQuest
quest
=
getMainQuest
().
getChildQuestById
(
subQuest
.
getSubId
());
GameQuest
quest
=
getMainQuest
().
getChildQuestById
(
subQuest
.
getSubId
());
if
(
quest
==
null
)
{
if
(
quest
==
null
)
{
QuestData
questData
=
GameData
.
getQuestDataMap
().
get
(
subQuest
.
getSubId
());
QuestData
questData
=
GameData
.
getQuestDataMap
().
get
(
subQuest
.
getSubId
());
if
(
questData
==
null
)
{
if
(
questData
==
null
||
questData
.
getAcceptCond
()
==
null
)
{
continue
;
continue
;
}
}
...
...
src/main/java/emu/grasscutter/game/quest/QuestManager.java
View file @
a227b44c
...
@@ -128,7 +128,7 @@ public class QuestManager {
...
@@ -128,7 +128,7 @@ public class QuestManager {
QuestData
data
=
quest
.
getData
();
QuestData
data
=
quest
.
getData
();
for
(
int
i
=
0
;
i
<
data
.
getFinishCond
().
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
data
.
getFinishCond
().
length
;
i
++)
{
if
(
quest
.
getFinishProgressList
()[
i
]
==
1
)
{
if
(
quest
.
getFinishProgressList
()
==
null
||
quest
.
getFinishProgressList
()
[
i
]
==
1
)
{
continue
;
continue
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment