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
|
||||
color color.Color
|
||||
super bool
|
||||
ownerID uint32
|
||||
id uint32
|
||||
}
|
||||
|
||||
@ -159,6 +160,9 @@ func (bullet *Bullet) tick(gameMap *GameMap,
|
||||
}
|
||||
hitPlayer := false
|
||||
for _, player := range players {
|
||||
if player.playerID == bullet.ownerID {
|
||||
continue
|
||||
}
|
||||
if hitPlayer {
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user