mirror of
https://github.com/renorris/openfsd
synced 2026-04-13 04:35:41 +08:00
properly store sendfast state
This commit is contained in:
@@ -167,10 +167,12 @@ func (s *Server) handlePilotPosition(client *Client, packet []byte) {
|
|||||||
// Check if we need to update the sendfast state
|
// Check if we need to update the sendfast state
|
||||||
if client.sendFastEnabled {
|
if client.sendFastEnabled {
|
||||||
if (client.closestVelocityClientDistance / 1852.0) > 5.0 { // 5.0 nautical miles
|
if (client.closestVelocityClientDistance / 1852.0) > 5.0 { // 5.0 nautical miles
|
||||||
|
client.sendFastEnabled = false
|
||||||
sendDisableSendFastPacket(client)
|
sendDisableSendFastPacket(client)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (client.closestVelocityClientDistance / 1852.0) < 5.0 { // 5.0 nautical miles
|
if (client.closestVelocityClientDistance / 1852.0) < 5.0 { // 5.0 nautical miles
|
||||||
|
client.sendFastEnabled = true
|
||||||
sendEnableSendFastPacket(client)
|
sendEnableSendFastPacket(client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user