fix(fight): 修复战斗逻辑中的一些潜在问题

- 在 `fight_leitai.go` 中增加玩家是否可以战斗的判断,避免非法挑战
- 注释掉部分冗余的日志打印与广播调用,并调整了擂台状态更新逻辑
- 修正 `effect_62.go` 中镇魂歌效果持续时间的处理方式,引入独立计数器 `duy`
- 优化随机精灵生成逻辑,确保 CatchTime 正确设置
- 增加对数据库操作错误的 panic 处理,提高代码健壮性
- 调整部分结构体指针传递,统一返回结构体指针以避免拷贝问题
- 移除未使用的导入包和调试日志,清理无用代码
```
This commit is contained in:
2025-11-20 21:37:37 +08:00
parent 9f89f9f259
commit 105c6f5a23
11 changed files with 62 additions and 33 deletions

View File

@@ -77,11 +77,11 @@ func PackWithOptions(w io.Writer, data interface{}, options *Options) error {
val = val.Convert(reflect.TypeOf([]byte{}))
}
size := packer.Sizeof(val, options)
if size == 0 {
// if size == 0 {
fmt.Println("size==0")
// fmt.Println("size==0")
}
// }
buf := make([]byte, size)
if _, err := packer.Pack(buf, val, options); err != nil {
return err