bug修复

This commit is contained in:
hahwu 2026-03-16 17:21:13 +08:00
parent a2997b3be5
commit cb5c5e91f7

View File

@ -83,7 +83,7 @@ type PlayerMsg struct {
func (p *Player) Stop() {
p.wg.Wait()
p.stopDispatcherLoop()
p.signalDispatcherStop()
p.msgChanOnce.Do(func() {
close(p.msgChan)
})
@ -94,11 +94,10 @@ func (p *Player) Stop() {
p.stop = true
}
func (p *Player) stopDispatcherLoop() {
func (p *Player) signalDispatcherStop() {
p.stopOnce.Do(func() {
close(p.stopSignal)
})
p.dispatcherWg.Wait()
}
func (p *Player) CallEvent(Duration time.Duration, F func(), Label string) {
@ -1389,11 +1388,6 @@ func (p *Player) DispatcherHandle() {
}()
}
func (p *Player) StopDispatcher() {
p.wg.Wait()
p.stopDispatcherLoop()
}
func CheckPlayerLose(Uid int) bool {
FriendSimpleData := G_GameLogicPtr.GetSimplePlayerByUid(Uid)
if FriendSimpleData == nil {