diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-03-01 11:45:15 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-03-01 13:56:33 -0800 |
commit | 30335063bff54c2b4782689eebdb3b2717e878fa (patch) | |
tree | 8cf4af06a0915e8741b51bbdcb19491d954b5c7f /src/map/magic-expr.cpp | |
parent | 777c013fe163348d1489fb9ca2e41cb135eec0d1 (diff) | |
download | tmwa-30335063bff54c2b4782689eebdb3b2717e878fa.tar.gz tmwa-30335063bff54c2b4782689eebdb3b2717e878fa.tar.bz2 tmwa-30335063bff54c2b4782689eebdb3b2717e878fa.tar.xz tmwa-30335063bff54c2b4782689eebdb3b2717e878fa.zip |
Convince skills to work
Diffstat (limited to 'src/map/magic-expr.cpp')
-rw-r--r-- | src/map/magic-expr.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index a366cc0..0acc50a 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -582,13 +582,17 @@ static int fun_skill(env_t *, int, val_t *result, val_t *args) { if (ENTITY_TYPE(0) != BL::PC - // don't convert to enum until after the range check + // don't convert to enum until after the range check || ARGINT(1) < 0 - || ARGINT(1) >= uint16_t(MAX_SKILL) - || ARGPC(0)->status.skill[SkillID(ARGINT(1))].id != SkillID(ARGINT(1))) + || ARGINT(1) >= uint16_t(MAX_SKILL)) + { RESULTINT = 0; + } else - RESULTINT = ARGPC(0)->status.skill[SkillID(ARGINT(1))].lv; + { + SkillID id = static_cast<SkillID>(ARGINT(1)); + RESULTINT = ARGPC(0)->status.skill[id].lv; + } return 0; } |