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
c9c45e4c
Commit
c9c45e4c
authored
Jul 21, 2022
by
Melledy
Browse files
Partial fix for player attacks in co-op not working
parent
ad0225df
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/recv/HandlerCombatInvocationsNotify.java
View file @
c9c45e4c
...
...
@@ -11,6 +11,7 @@ import emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult;
import
emu.grasscutter.net.proto.CombatInvocationsNotifyOuterClass.CombatInvocationsNotify
;
import
emu.grasscutter.net.proto.CombatInvokeEntryOuterClass.CombatInvokeEntry
;
import
emu.grasscutter.net.proto.EntityMoveInfoOuterClass.EntityMoveInfo
;
import
emu.grasscutter.net.proto.EvtAnimatorParameterInfoOuterClass.EvtAnimatorParameterInfo
;
import
emu.grasscutter.net.proto.EvtBeingHitInfoOuterClass.EvtBeingHitInfo
;
import
emu.grasscutter.net.packet.PacketHandler
;
import
emu.grasscutter.net.proto.MotionInfoOuterClass.MotionInfo
;
...
...
@@ -33,6 +34,7 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
public
void
handle
(
GameSession
session
,
byte
[]
header
,
byte
[]
payload
)
throws
Exception
{
CombatInvocationsNotify
notif
=
CombatInvocationsNotify
.
parseFrom
(
payload
);
for
(
CombatInvokeEntry
entry
:
notif
.
getInvokeListList
())
{
// Handle combat invoke
switch
(
entry
.
getArgumentType
())
{
case
COMBAT_TYPE_ARGUMENT_EVT_BEING_HIT:
EvtBeingHitInfo
hitInfo
=
EvtBeingHitInfo
.
parseFrom
(
entry
.
getCombatData
());
...
...
@@ -83,6 +85,19 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
handleFallOnGround
(
session
,
entity
,
motionState
);
}
}
// MOTION_STATE_NOTIFY = Dont send to other players
if
(
motionState
==
MotionState
.
MOTION_STATE_NOTIFY
)
{
continue
;
}
}
break
;
case
COMBAT_TYPE_ARGUMENT_ANIMATOR_PARAMETER_CHANGED:
EvtAnimatorParameterInfo
paramInfo
=
EvtAnimatorParameterInfo
.
parseFrom
(
entry
.
getCombatData
());
if
(
paramInfo
.
getIsServerCache
())
{
paramInfo
=
paramInfo
.
toBuilder
().
setIsServerCache
(
false
).
build
();
entry
=
entry
.
toBuilder
().
setCombatData
(
paramInfo
.
toByteString
()).
build
();
}
break
;
default
:
...
...
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