summaryrefslogtreecommitdiff
path: root/src/map/script-fun.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-09-17 22:07:44 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-15 11:46:51 -0400
commit0fd54ac797cea996ba3430168b4a962df13c12fa (patch)
tree5a945c951ed7d9158d78b53aa75a031edbda3f5d /src/map/script-fun.cpp
parent050f810ced9e9f600178873d378c50f057a8e7e9 (diff)
downloadtmwa-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.cpp12
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);
}
}