fix(fight): 修复战斗逻辑中的条件判断错误 - 修复 IsFirst 方法中的缩进问题 - 修正 IsWin 方法中的条件判断逻辑,将 !v.Alive() 改为 v.Alive() ```
This commit is contained in:
@@ -99,8 +99,8 @@ func (f *FightC) GetRand() *rand.Rand {
|
||||
// // 获取随机数
|
||||
func (f *FightC) IsFirst(play common.PlayerI) bool {
|
||||
|
||||
return f.TrueFirst.Player == play
|
||||
}
|
||||
return f.TrueFirst.Player == play
|
||||
}
|
||||
func (f *FightC) Chat(c common.PlayerI, msg string) {
|
||||
|
||||
f.GetInputByPlayer(c, true).Player.SendPackCmd(50002, &user.ChatOutboundInfo{
|
||||
@@ -235,7 +235,7 @@ func initfightready(in *input.Input) (model.FightUserInfo, []model.ReadyFightPet
|
||||
func (f *FightC) IsWin(c *input.Input) bool {
|
||||
|
||||
for _, v := range f.GetInputByPlayer(c.Player, true).AllPet {
|
||||
if !v.Alive() { //如果存活
|
||||
if v.Alive() { //如果存活
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user