Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 132c3fb

Browse files
committed
财富增加 0 bugfix
1 parent e87e76b commit 132c3fb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/logic/observer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ func (UserRichObserver) Update(action string, uid, objtype, objid int) {
317317
} else if action == actionModify {
318318
// TODO:修改暂时不消耗铜币
319319
// DefaultUserRich.IncrUserRich(uid, model.MissionTypeModify, -2, desc)
320+
return
320321
} else if action == actionView {
321322
return
322323
}

src/logic/user_rich.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ func (self UserRichLogic) AwardCooper() {
8888

8989
// IncrUserRich 增加或减少用户财富
9090
func (self UserRichLogic) IncrUserRich(user *model.User, typ, award int, desc string) {
91+
if award == 0 {
92+
logger.Errorln("IncrUserRich, but award is empty!")
93+
return
94+
}
95+
9196
var (
9297
total int64 = -1
9398
err error

0 commit comments

Comments
 (0)