Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
Add Z value to Positions in EntityUpdate (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArlindoTorres authored and markus-wa committed Mar 23, 2019
1 parent 78e6210 commit 28529ba
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 144 deletions.
2 changes: 1 addition & 1 deletion csminify.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (m *minifier) tickDone(e events.TickDone) {
}

func r3VectorToPoint(v r3.Vector) rep.Point {
return rep.Point{X: int(v.X), Y: int(v.Y)}
return rep.Point{X: int(v.X), Y: int(v.Y), Z: int(v.Z)}
}

// roundTo wraps math.Round and allows specifying the rounding precision.
Expand Down
1 change: 1 addition & 0 deletions protobuf/gen/proto/replay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum Team {
message Point {
int32 x = 1;
int32 y = 2;
int32 z = 3;
}

message Replay {
Expand Down
398 changes: 255 additions & 143 deletions protobuf/gen/replay.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions protobuf/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func mapToPosition(p rep.Point) *gen.Point {
return &gen.Point{
X: int32(p.X),
Y: int32(p.Y),
Z: int32(p.Z),
}
}

Expand Down
1 change: 1 addition & 0 deletions protobuf/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func mapFromPosition(p *gen.Point) rep.Point {
return rep.Point{
X: int(p.X),
Y: int(p.Y),
Z: int(p.Z),
}
}

Expand Down
1 change: 1 addition & 0 deletions replay/nondefault/nondefault_replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func init() {
pos = append(pos, rep.Point{
X: 1124,
Y: -321,
Z: 24,
})

var entUpd []rep.EntityUpdate
Expand Down
1 change: 1 addition & 0 deletions replay/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type EntityUpdate struct {
type Point struct {
X int `json:"x" msgpack:"x"`
Y int `json:"y" msgpack:"y"`
Z int `json:"z" msgpack:"z"`
}

// Tick contains all events occurring at a specific tick
Expand Down

0 comments on commit 28529ba

Please sign in to comment.