Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
d9f85ba2
Commit
d9f85ba2
authored
2 years ago
by
AnimeGitB
Browse files
Options
Downloads
Patches
Plain Diff
Allow adding constellations to playerless avatars
Fixes #1682
parent
c517b8a2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/emu/grasscutter/game/avatar/Avatar.java
+8
-3
8 additions, 3 deletions
src/main/java/emu/grasscutter/game/avatar/Avatar.java
with
8 additions
and
3 deletions
src/main/java/emu/grasscutter/game/avatar/Avatar.java
+
8
−
3
View file @
d9f85ba2
...
...
@@ -624,6 +624,8 @@ public class Avatar {
public
void
calcConstellation
(
OpenConfigEntry
entry
,
boolean
notifyClient
)
{
if
(
entry
==
null
)
return
;
if
(
this
.
getPlayer
()
==
null
)
notifyClient
=
false
;
// Check if new constellation adds +3 to a skill level
if
(
this
.
calcConstellationExtraLevels
(
entry
)
&&
notifyClient
)
{
...
...
@@ -754,9 +756,10 @@ public class Avatar {
// Get talent
AvatarTalentData
talentData
=
GameData
.
getAvatarTalentDataMap
().
get
(
talentId
);
if
(
talentData
==
null
)
return
false
;
var
player
=
this
.
getPlayer
();
// Pay constellation item if possible
if
(!
skipPayment
&&
!
this
.
getPlayer
()
.
getInventory
().
payItem
(
talentData
.
getMainCostItemId
(),
1
))
{
if
(!
skipPayment
&&
(
player
!=
null
)
&&
!
player
.
getInventory
().
payItem
(
talentData
.
getMainCostItemId
(),
1
))
{
return
false
;
}
...
...
@@ -764,8 +767,10 @@ public class Avatar {
this
.
talentIdList
.
add
(
talentData
.
getId
());
// Packet
this
.
getPlayer
().
sendPacket
(
new
PacketAvatarUnlockTalentNotify
(
this
,
talentId
));
this
.
getPlayer
().
sendPacket
(
new
PacketUnlockAvatarTalentRsp
(
this
,
talentId
));
if
(
player
!=
null
)
{
player
.
sendPacket
(
new
PacketAvatarUnlockTalentNotify
(
this
,
talentId
));
player
.
sendPacket
(
new
PacketUnlockAvatarTalentRsp
(
this
,
talentId
));
}
// Proud skill bonus map (Extra skills)
this
.
calcConstellation
(
GameData
.
getOpenConfigEntries
().
get
(
talentData
.
getOpenConfig
()),
true
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment