This commit is contained in:
@@ -247,21 +247,24 @@ func (f *FightC) collectPlayerActions(ourID, oppID uint32) map[uint32]action.Bat
|
||||
//fmt.Println("玩家执行动作:", pid, paction.Priority())
|
||||
|
||||
case <-timeout:
|
||||
f.handleTimeout(ourID, oppID, actions)
|
||||
return actions
|
||||
r := f.handleTimeout(ourID, oppID, actions)
|
||||
if r {
|
||||
return actions
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return actions
|
||||
}
|
||||
|
||||
// 超时处理逻辑
|
||||
func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.BattleActionI) {
|
||||
func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.BattleActionI) bool {
|
||||
|
||||
if f.Info.Status == info.BattleMode.FIGHT_WITH_NPC {
|
||||
// f.WinnerId = 0
|
||||
|
||||
go f.Our.GetAction() //boss出手后获取出招
|
||||
|
||||
return false
|
||||
} else {
|
||||
var pid uint32
|
||||
for _, pid = range []uint32{ourID, oppID} {
|
||||
@@ -275,6 +278,7 @@ func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.Ba
|
||||
f.WinnerId = f.GetInputByPlayer(f.getPlayerByID(pid), false).Player.GetInfo().UserID
|
||||
f.Reason = info.BattleOverReason.PlayerOVerTime
|
||||
f.closefight = true
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user