This commit is contained in:
aozhiwei 2024-11-22 16:28:31 +08:00
parent c48861a913
commit 583e193fce
2 changed files with 6 additions and 4 deletions

View File

@ -17,9 +17,11 @@ type ItemTable struct {
}
func (this *Item) Init1() {
tmpStrs := strings.Split(this.Item.GetBuffList(), "|")
for str := range(tmpStrs) {
q5.AppendSlice(&this.buffList, q5.ToInt32(str))
if this.Item.GetBuffList() != "" {
tmpStrs := strings.Split(this.Item.GetBuffList(), "|")
for _, val := range(tmpStrs) {
q5.AppendSlice(&this.buffList, q5.ToInt32(val))
}
}
}

View File

@ -26,7 +26,7 @@ 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) {
for _, buffId := range(buffList) {
buffMeta := mt.Table.Buff.GetById(int64(buffId))
if buffMeta != nil {
buffModel := new(model.Buff)