```
refactor(controller): 替换BossCompletedTask为专用方法名 在战斗控制器中将p.BossCompletedTask替换为p.SptCompletedTask, 以及在塔沃控制器中将BossCompletedTask相关调用替换为TawerCompletedTask, 以更好地区分不同的任务完成逻辑。 --- fix(item_use): 添加nil检查防止程序崩溃 在处理神经元道具时,增加对oldPet对象的nil检查, 如果为空则返回系统错误码,避免程序出现
This commit is contained in:
@@ -77,12 +77,16 @@ func (s *PetService) PetInfo_One_ohter(userid, cachetime uint32) model.PetEX {
|
||||
tt.Data.CatchTime = tt.CatchTime
|
||||
return tt
|
||||
}
|
||||
func (s *PetService) PetInfo_One_Unscoped(cachetime uint32) model.PetEX {
|
||||
func (s *PetService) PetInfo_One_Unscoped(cachetime uint32) *model.PetEX {
|
||||
|
||||
m := s.TestModel(s.Model).Where("player_id", s.userid).Where("catch_time", cachetime).Unscoped()
|
||||
var tt model.PetEX
|
||||
var tt *model.PetEX
|
||||
|
||||
m.Scan(&tt)
|
||||
if tt == nil {
|
||||
return nil
|
||||
|
||||
}
|
||||
tt.Data.CatchTime = tt.CatchTime
|
||||
return tt
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ func (s *RoomService) Get(userid uint32) model.BaseHouseEx {
|
||||
// }
|
||||
func (s *RoomService) Set(id []model.FitmentShowInfo) {
|
||||
//todo待测试
|
||||
if cool.Config.ServerInfo.IsVip != 0 {
|
||||
cool.Logger.Info(context.TODO(), "测试服不消耗物品玩家数据", s.userid)
|
||||
return
|
||||
}
|
||||
var ttt model.BaseHouseEx
|
||||
m := s.TestModel(s.Model)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user