mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-10 17:33:02 +08:00
small nullpointer fix in EntityGadget, in case meta gadget is not set
This commit is contained in:
parent
bb8ae4c443
commit
964e73f0f6
@ -219,9 +219,12 @@ public class EntityGadget extends EntityBaseGadget {
|
|||||||
.setConfigId(this.getConfigId())
|
.setConfigId(this.getConfigId())
|
||||||
.setGadgetState(this.getState())
|
.setGadgetState(this.getState())
|
||||||
.setIsEnableInteract(true)
|
.setIsEnableInteract(true)
|
||||||
.setDraftId(this.metaGadget.draft_id)
|
|
||||||
.setAuthorityPeerId(this.getScene().getWorld().getHostPeerId());
|
.setAuthorityPeerId(this.getScene().getWorld().getHostPeerId());
|
||||||
|
|
||||||
|
if(this.metaGadget != null) {
|
||||||
|
gadgetInfo.setDraftId(this.metaGadget.draft_id);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.getContent() != null) {
|
if (this.getContent() != null) {
|
||||||
this.getContent().onBuildProto(gadgetInfo);
|
this.getContent().onBuildProto(gadgetInfo);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user