fix(xp): strange comportment with -=
This commit is contained in:
parent
e78c8d8c42
commit
76745af0e8
1 changed files with 2 additions and 3 deletions
|
@ -51,7 +51,7 @@ func LastEventUpdate(c *Copaing) {
|
|||
utils.SendWarn("lose - xp already removed is negative", "lose", l, "xp", xp)
|
||||
c.XP = 0
|
||||
} else {
|
||||
c.XP -= l - c.XPAlreadyRemoved()
|
||||
c.XP = c.XP - l + c.XPAlreadyRemoved()
|
||||
}
|
||||
c.Save()
|
||||
c.SetLastEvent()
|
||||
|
@ -63,10 +63,9 @@ func XPUpdate(c *Copaing) {
|
|||
xp := c.XPAlreadyRemoved()
|
||||
if l-xp < 0 {
|
||||
utils.SendWarn("lose - xp already removed is negative", "lose", l, "xp", xp)
|
||||
c.XP = 0
|
||||
c.AddXPAlreadyRemoved(0)
|
||||
} else {
|
||||
c.XP -= l - c.XPAlreadyRemoved()
|
||||
c.XP = c.XP - l + xp
|
||||
c.AddXPAlreadyRemoved(l - xp)
|
||||
}
|
||||
c.Save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue