This commit is contained in:
aozhiwei 2024-11-22 14:03:49 +08:00
parent 42063e9cd9
commit e390bcfb03

View File

@ -25,11 +25,19 @@ func (this *buff) List(accountId string) (error, []*model.Buff) {
}
func (this *buff) Add(accountId string, buffList []int32) {
nowTime := int32(f5.GetApp().GetRealSeconds())
for buffId := range(buffList) {
buffMeta := mt.Table.Buff.GetById(int64(buffId))
if buffMeta != nil {
buffModel := new(model.Buff)
if buffMeta.GetCanStack() == 0 {
buffModel.AccountId = accountId
buffModel.BuffId = buffMeta.GetBuffId()
buffModel.StartTime = nowTime
buffModel.EffectiveTime = buffMeta.GetDurationTime()
buffModel.CreateTime = nowTime
buffModel.ModifyTime = nowTime
buffModel.Create()
} else {
}