diff options
-rw-r--r-- | serialize.go | 64 | ||||
-rw-r--r-- | tocltcmds.go | 2 |
2 files changed, 54 insertions, 12 deletions
diff --git a/serialize.go b/serialize.go index 8dc2353..a670b2c 100644 --- a/serialize.go +++ b/serialize.go @@ -2861,18 +2861,57 @@ func (obj *ToCltHP) Serialize(w io.Writer) { { x := (*(*(struct { HP uint16 + //mt:opt + DamageEffect bool }))(obj)).HP write16(w, uint16(x)) } + if err := pcall(func() { + { + x := (*(*(struct { + HP uint16 + //mt:opt + DamageEffect bool + }))(obj)).DamageEffect + if x { + write8(w, 1) + } else { + write8(w, 0) + } + } + }); err != nil && err != io.EOF { + chk(err) + } } func (obj *ToCltHP) Deserialize(r io.Reader) { { p := &(*(*(struct { HP uint16 + //mt:opt + DamageEffect bool }))(obj)).HP *p = read16(r) } + if err := pcall(func() { + { + p := &(*(*(struct { + HP uint16 + //mt:opt + DamageEffect bool + }))(obj)).DamageEffect + switch n := read8(r); n { + case 0: + *p = false + case 1: + *p = true + default: + chk(fmt.Errorf("invalid bool: %d", n)) + } + } + }); err != nil && err != io.EOF { + chk(err) + } } func (obj *ToCltMovePlayer) Serialize(w io.Writer) { @@ -34979,22 +35018,23 @@ func (obj *ToolCaps) Serialize(w io.Writer) { ow := w w := new(bytes.Buffer) /* - if r.N > 0 { (*(*(struct { - //mt:if _ = %s; false - NonNil bool + if r.N > 0 { (*(*(struct { + //mt:if _ = %s; false + NonNil bool - AttackCooldown float32 - MaxDropLvl int16 + AttackCooldown float32 + MaxDropLvl int16 - //mt:len32 - GroupCaps []ToolGroupCap + //mt:len32 + GroupCaps []ToolGroupCap - //mt:len32 - DmgGroups []Group + //mt:len32 + DmgGroups []Group - //mt:32tou16 - PunchUses int32 - }))(obj)).NonNil = true}; /**/{ + //mt:32tou16 + PunchUses int32 + }))(obj)).NonNil = true}; /* + */{ if (*(*(struct { //mt:if _ = %s; false NonNil bool diff --git a/tocltcmds.go b/tocltcmds.go index 9563bc8..54ab788 100644 --- a/tocltcmds.go +++ b/tocltcmds.go @@ -233,6 +233,8 @@ type ToCltAOMsgs struct { // ToCltHP updates the player's HP on the client. type ToCltHP struct { HP uint16 + //mt:opt + DamageEffect bool } // ToCltMovePlayer tells the client that the player has been moved server-side. |