Disable shooting self(helps on laggy servers)
This commit is contained in:
parent
90a1177a63
commit
d310509035
@ -14,6 +14,7 @@ type Bullet struct {
|
|||||||
direction uint8
|
direction uint8
|
||||||
color color.Color
|
color color.Color
|
||||||
super bool
|
super bool
|
||||||
|
ownerID uint32
|
||||||
id uint32
|
id uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,6 +160,9 @@ func (bullet *Bullet) tick(gameMap *GameMap,
|
|||||||
}
|
}
|
||||||
hitPlayer := false
|
hitPlayer := false
|
||||||
for _, player := range players {
|
for _, player := range players {
|
||||||
|
if player.playerID == bullet.ownerID {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if hitPlayer {
|
if hitPlayer {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user