Skip to content

Commit

Permalink
fix "error beep" when ordering a Hive to move
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte committed Dec 21, 2023
1 parent 6f6fb90 commit b96e1ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scenes/staging/staging_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ func (c *Controller) executeAction(choice selectedChoice) bool {
relocationVec := selectedColony.pos.VecTowards(clickPos, 1).Mulf(dist)
relocationPos = correctedPos(c.world.rect, relocationVec.Add(selectedColony.pos), 128)
if c.world.coreDesign == gamedata.HiveCoreStats {
return c.setHiveRallyPoint(selectedColony, relocationPos)
return c.setHiveRallyPoint(selectedColony, clickPos, relocationPos)
}
return c.launchRelocation(selectedColony, dist, relocationPos)
case specialIncreaseRadius:
Expand Down Expand Up @@ -1440,8 +1440,8 @@ func (c *Controller) findRelocationPoint(core *colonyCoreNode, dist float64, dst
return gmath.Vec{}
}

func (c *Controller) setHiveRallyPoint(core *colonyCoreNode, dst gmath.Vec) bool {
if dst.DistanceTo(core.rallyPoint) <= 20 {
func (c *Controller) setHiveRallyPoint(core *colonyCoreNode, origDst, dst gmath.Vec) bool {
if origDst.DistanceTo(core.GetRallyPoint()) <= 20 {
return false
}

Expand Down

0 comments on commit b96e1ae

Please sign in to comment.