update delete

This commit is contained in:
shoopea
2021-11-12 09:17:25 +08:00
parent caba808d8b
commit 24bf4dc386
3 changed files with 12 additions and 8 deletions

4
ttd.go
View File

@@ -624,11 +624,11 @@ func (s *ServerTTD) ComputeClientTime() {
}
func (s *ServerTTD) DeleteCompany(id uint8) {
if _, ok := s.Status.Companies[id]; ok {
if co, ok := s.Status.Companies[id]; ok {
logInfoDebug("Server.DeleteCompany : deleting #%d", id)
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
Command: fmt.Sprintf("reset_company %d", id),
Command: fmt.Sprintf("reset_company %d", co.CompanyExtlID),
}
s.Send(px.Bytes())
px = PacketAdminRCon{