Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
oq-x committed Oct 22, 2023
1 parent 6589558 commit 7c821c6
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions server/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,31 +132,13 @@ func direction(ya, pi float32) (x, y, z float64) {
func (p *Session) Hit(entityId int32) {
e := p.Server.FindEntity(entityId)
x, y, z := p.Position()
//yaw, pitch := p.Rotation()
//d := direction(yaw, pitch)
soundId := int32(519)
if pl, ok := e.(*Session); ok {
if pl.GameMode() == 1 {
return
}
health := pl.player.Health()
pl.SetHealth(health - 1)
x1, y1, z1 := pl.Position()
/*switch d {
case 0:
x1 += 0.5
z1 += 0.5
case 1:
x1 += 0.5
z1 -= 0.5
case 2:
x1 -= 0.5
z1 += 0.5
case 3:
x1 -= 0.5
z1 -= 0.5
}*/
pl.Push(x1, y1, z1)
pl.SendPacket(&packet.DamageEvent{
EntityID: entityId,
SourceTypeID: 1,
Expand Down

0 comments on commit 7c821c6

Please sign in to comment.