|
Ethan Newbie
Joined: 14 Apr 2014 Posts: 4
|
Posted: Mon May 12, 2014 12:39 pm
%ismember woes |
I ran into a problem with %ismember that's causing me a bit of trouble.
What I'm doing is %ismember(@afflictions,@herbable) {herb}
so when it runs into an affliction that can be cured stored in the stringlist herbable, it pops out the cure.
While it works fine when there's only one affliction that matches herbable in affliction, whenever more than one affliction is inside @affliction, it stops matching.
Can anyone let me know what I'm doing wrong?
Thanks! |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Mon May 12, 2014 4:41 pm |
The first parameter to %ismember has to be a single item, not a list. If you want to check them all, you'll need to explicitly loop through the list:
Code: |
#forall @afflictions {#if %ismember(%i, @herbable) {do something}} |
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|