summaryrefslogtreecommitdiff
path: root/src/scripting/lua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripting/lua.cpp')
-rw-r--r--src/scripting/lua.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index fc505eb4..fe777a0c 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -1192,7 +1192,12 @@ static int chr_give_exp(lua_State *s)
int exp = lua_tointeger(s, 3);
- c->receiveExperience(skill, exp);
+ int optimalLevel = 0;
+ if (lua_isnumber(s, 4))
+ {
+ optimalLevel = lua_tointeger(s, 4);
+ }
+ c->receiveExperience(skill, exp, optimalLevel);
return 0;
}