refactor: load/save state as ptr
This commit is contained in:
@@ -15,7 +15,7 @@ type Battle struct {
|
||||
BattleReport BattleReport
|
||||
|
||||
shipAmmo map[int]uint
|
||||
attacker map[int]map[int]float64 // a group able to attack and destroy an opponent with some probability
|
||||
attacker map[int]map[int]float64 // a group able to attack and destroy an opponent with some probability > 0
|
||||
}
|
||||
|
||||
type BattleReport struct {
|
||||
@@ -200,7 +200,7 @@ func SingleBattle(g *Game, b *Battle) {
|
||||
case probability > 0:
|
||||
destroyed = rand.Float64() >= probability
|
||||
default:
|
||||
panic("probabilities cache returned unexpected value")
|
||||
panic("SingleBattle: probability unexpected: value <= 0")
|
||||
}
|
||||
|
||||
b.BattleReport.BattleAction = append(b.BattleReport.BattleAction, BattleAction{
|
||||
|
||||
Reference in New Issue
Block a user