prevent user.stats.points from being negative e.g., after dropping level with Fix Character Values (still need to remove allocated points then)
This commit is contained in:
@@ -1384,6 +1384,10 @@ api.wrap = (user, main=true) ->
|
||||
else
|
||||
# add new allocatable points. We could do user.stats.points++, but this does a fail-safe just in case
|
||||
user.stats.points = user.stats.lvl - (user.stats.con + user.stats.str + user.stats.per + user.stats.int);
|
||||
if user.stats.points < 0
|
||||
user.stats.points = 0
|
||||
# This happens after dropping level with Fix Character Values and perhaps from other causes.
|
||||
# TODO: Subtract points from attributes in the same manner as on death.
|
||||
|
||||
user.stats.hp = 50
|
||||
user.stats.exp = stats.exp
|
||||
|
||||
Reference in New Issue
Block a user