summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-04-25 19:34:25 +0200
committerHaru <haru@dotalux.com>2015-04-25 19:34:33 +0200
commit948be86481160443006dfe65b1bb35e1538c1bec (patch)
treef95733bf6c72551e9d1b1513eb8a56cc792459c1 /npc
parent0f7a7933f8940c2d8ae1d739d11dc9c80ffda61a (diff)
downloadhercules-948be86481160443006dfe65b1bb35e1538c1bec.tar.gz
hercules-948be86481160443006dfe65b1bb35e1538c1bec.tar.bz2
hercules-948be86481160443006dfe65b1bb35e1538c1bec.tar.xz
hercules-948be86481160443006dfe65b1bb35e1538c1bec.zip
Added getvariableofnpc checks to the test suite
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'npc')
-rw-r--r--npc/dev/test.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index 9c2de9a55..73c9ed975 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -603,6 +603,11 @@ function script HerculesSelfTestHelper {
setd(".@x", getd(".@y"));
callsub(OnCheck, "setd getd", .@x, .@y);
+ // getvariableofnpc
+ .x = 2;
+ set getvariableofnpc(.x, "TestVarOfAnotherNPC"), 1;
+ callsub(OnCheck, "Setting NPC variables of another NPC", getvariableofnpc(.x, "TestVarOfAnotherNPC"), 1);
+ callsub(OnCheck, "Setting NPC variables of another NPC (local variable overwrite check)", .x, 2);
// Callsub (advanced)
callsub(OnCheck, "Callsub return value", callsub(OnTestReturnValue, 1));
@@ -634,6 +639,7 @@ function script HerculesSelfTestHelper {
.x = 2;
set getvariableofnpc(.x, "TestVarOfAnotherNPC"), 1;
callsub(OnCheck, "Callsub (return NPC variables from another NPC)", callsub(OnTestVarOfAnotherNPC, "TestVarOfAnotherNPC"), 1);
+ callsub(OnCheck, "Callsub (return NPC variables from another NPC - local variable overwrite check)", .x, 2);
// Callfunc
callsub(OnCheck, "Callfunc return value", callfunc("F_TestReturnValue", 1));
@@ -682,6 +688,7 @@ function script HerculesSelfTestHelper {
.x = 2;
set getvariableofnpc(.x, "TestVarOfAnotherNPC"), 1;
callsub(OnCheck, "Callfunc (return NPC variables from another NPC)", callfunc("F_TestVarOfAnotherNPC", "TestVarOfAnotherNPC"), 1);
+ callsub(OnCheck, "Callfunc (return NPC variables from another NPC - local variable overwrite check)", .x, 2);
if (.errors) {
debugmes "Script engine self-test [ \033[0;31mFAILED\033[0m ]";
@@ -723,7 +730,7 @@ OnTestScopeArrays:
setarray .@x, 1, 2, 3, 4;
copyarray .@y, getarg(0), getarraysize(getarg(0));
return getarraysize(.@y);
-
+
OnTestVarOfAnotherNPC:
return getvariableofnpc(.x, getarg(0));