一个体力刷新的小bug
This commit is contained in:
parent
ff4f7bc196
commit
f16e990078
@ -679,9 +679,10 @@ func (this *User) change(session comm.IUserSession, attrs map[string]int32) (atn
|
||||
}
|
||||
return
|
||||
}
|
||||
this.recoverUserPs(user)
|
||||
user.Ps += add
|
||||
userEx.ConsumPs += -add
|
||||
this.recoverUserPs(user)
|
||||
|
||||
change.Ps = user.Ps
|
||||
go this.ModuleUiGame.HDPSTodayConsum(session.GetUserId(), userEx.ConsumPs)
|
||||
} else {
|
||||
@ -1104,7 +1105,7 @@ func (this *User) recoverUserPs(user *pb.DBUser) (change bool, total int32, next
|
||||
yu int32
|
||||
add int32
|
||||
)
|
||||
|
||||
cur := configure.Now().Unix()
|
||||
ggd := this.ModuleTools.GetGlobalConf()
|
||||
if ggd == nil {
|
||||
return
|
||||
@ -1114,10 +1115,11 @@ func (this *User) recoverUserPs(user *pb.DBUser) (change bool, total int32, next
|
||||
return
|
||||
}
|
||||
if user.Ps >= pconf.PsCeiling {
|
||||
user.LastRecoverPsSec = cur
|
||||
return
|
||||
}
|
||||
total = pconf.PsCeiling
|
||||
cur := configure.Now().Unix()
|
||||
|
||||
if user.LastRecoverPsSec == 0 {
|
||||
user.LastRecoverPsSec = cur
|
||||
change = true
|
||||
|
Loading…
Reference in New Issue
Block a user