diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-09-17 22:07:44 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-04-15 11:46:51 -0400 |
commit | 0fd54ac797cea996ba3430168b4a962df13c12fa (patch) | |
tree | 5a945c951ed7d9158d78b53aa75a031edbda3f5d /src/map/script-fun.cpp | |
parent | 050f810ced9e9f600178873d378c50f057a8e7e9 (diff) | |
download | tmwa-0fd54ac797cea996ba3430168b4a962df13c12fa.tar.gz tmwa-0fd54ac797cea996ba3430168b4a962df13c12fa.tar.bz2 tmwa-0fd54ac797cea996ba3430168b4a962df13c12fa.tar.xz tmwa-0fd54ac797cea996ba3430168b4a962df13c12fa.zip |
allow to get another player's account vars
Diffstat (limited to 'src/map/script-fun.cpp')
-rw-r--r-- | src/map/script-fun.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index f8c81c4..3592095 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -3471,7 +3471,17 @@ void builtin_get(ScriptState *st) } else { - int var = pc_readreg(bl, reg); + int var; + if (prefix == '#' && bl) + { + if (name_[1] == '#') + var = pc_readaccountreg2(bl->is_player(), stringish<VarName>(name_)); + else + var = pc_readaccountreg(bl->is_player(), stringish<VarName>(name_)); + } + else + var = pc_readreg(bl, reg); + push_int<ScriptDataInt>(st->stack, var); } } |