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
7f898417
Commit
7f898417
authored
Jul 18, 2022
by
Melledy
Browse files
Fix a few null pointer issues.
parent
2e85834e
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/data/excels/ReliquaryLevelData.java
View file @
7f898417
...
...
@@ -5,13 +5,15 @@ import java.util.List;
import
emu.grasscutter.data.GameResource
;
import
emu.grasscutter.data.ResourceType
;
import
emu.grasscutter.game.props.FightProperty
;
import
it.unimi.dsi.fastutil.ints.Int2FloatMap
;
import
it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectMap
;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
@ResourceType
(
name
=
"ReliquaryLevelExcelConfigData.json"
)
public
class
ReliquaryLevelData
extends
GameResource
{
private
int
id
;
private
Int2
ObjectMap
<
Float
>
propMap
;
private
Int2Float
Map
propMap
;
private
int
rank
;
private
int
level
;
...
...
@@ -40,15 +42,15 @@ public class ReliquaryLevelData extends GameResource {
}
public
float
getPropValue
(
int
id
)
{
return
propMap
.
get
(
id
);
return
propMap
.
get
OrDefault
(
id
,
0
f
);
}
@Override
public
void
onLoad
()
{
this
.
id
=
(
rank
<<
8
)
+
this
.
getLevel
();
this
.
propMap
=
new
Int2
Objec
tOpenHashMap
<>
();
this
.
propMap
=
new
Int2
Floa
tOpenHashMap
();
for
(
RelicLevelProperty
p
:
addProps
)
{
this
.
propMap
.
put
(
FightProperty
.
getPropByName
(
p
.
getPropType
()).
getId
(),
(
Float
)
p
.
getValue
());
this
.
propMap
.
put
(
FightProperty
.
getPropByName
(
p
.
getPropType
()).
getId
(),
p
.
getValue
());
}
}
...
...
src/main/java/emu/grasscutter/server/packet/recv/HandlerQueryPathReq.java
View file @
7f898417
...
...
@@ -4,6 +4,7 @@ import emu.grasscutter.net.packet.Opcodes;
import
emu.grasscutter.net.packet.PacketOpcodes
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.proto.QueryPathReqOuterClass
;
import
emu.grasscutter.net.proto.QueryPathReqOuterClass.QueryPathReq
;
import
emu.grasscutter.server.game.GameSession
;
import
emu.grasscutter.server.packet.send.PacketQueryPathRsp
;
...
...
@@ -12,12 +13,15 @@ public class HandlerQueryPathReq extends PacketHandler {
@Override
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
var
req
=
QueryPathReqOuterClass
.
QueryPathReq
.
parseFrom
(
payload
);
var
req
=
QueryPathReq
.
parseFrom
(
payload
);
/**
* It is not the actual work
*/
if
(
req
.
getDestinationPosList
().
size
()
>
0
)
{
session
.
send
(
new
PacketQueryPathRsp
(
req
));
}
}
}
src/main/java/emu/grasscutter/tools/Tools.java
View file @
7f898417
...
...
@@ -159,8 +159,10 @@ final class ToolsWithLanguageOption {
for
(
Integer
id
:
list
)
{
QuestData
data
=
GameData
.
getQuestDataMap
().
get
(
id
);
MainQuestData
mainQuest
=
GameData
.
getMainQuestDataMap
().
get
(
data
.
getMainId
());
if
(
mainQuest
!=
null
)
{
writer
.
println
(
data
.
getId
()
+
" : "
+
map
.
get
(
mainQuest
.
getTitleTextMapHash
())
+
" - "
+
map
.
get
(
data
.
getDescTextMapHash
()));
}
}
writer
.
println
();
...
...
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