summaryrefslogtreecommitdiff
path: root/src/map/magic-stmt.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2008-11-23 23:30:51 -0700
committerFate <fate-tmw@googlemail.com>2008-11-23 23:30:51 -0700
commit5bb68970dece3052f5bf82d53bec8c6eeac60e15 (patch)
treec1ca7cf0d8f5f88f35b1bccdaf844e716066d62c /src/map/magic-stmt.c
parent8678e872c4a8f5ce67f135bf2f5e6b44b4ba2997 (diff)
downloadtmwa-5bb68970dece3052f5bf82d53bec8c6eeac60e15.tar.gz
tmwa-5bb68970dece3052f5bf82d53bec8c6eeac60e15.tar.bz2
tmwa-5bb68970dece3052f5bf82d53bec8c6eeac60e15.tar.xz
tmwa-5bb68970dece3052f5bf82d53bec8c6eeac60e15.zip
Magic: looping over spells, spell field access, is-equipped check
Diffstat (limited to 'src/map/magic-stmt.c')
-rw-r--r--src/map/magic-stmt.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/map/magic-stmt.c b/src/map/magic-stmt.c
index 9760674..3d28b3f 100644
--- a/src/map/magic-stmt.c
+++ b/src/map/magic-stmt.c
@@ -504,40 +504,6 @@ op_override_attack(env_t *env, int args_nr, val_t *args)
return 0;
}
-static int // ret -1: not a string, ret 1: no such item, ret 0: OK
-find_item(val_t *args, int index, struct item *item, int *stackable)
-{
- struct item_data *item_data;
- int must_add_sequentially;
-
- if (TY(index) == TY_INT)
- item_data = itemdb_exists(ARGINT(index));
- else if (TY(index) == TY_STRING)
- item_data = itemdb_searchname(ARGSTR(index));
- else
- return -1;
-
- if (!item_data)
- return 1;
-
- must_add_sequentially = (item_data->type == 4
- || item_data->type == 5
- || item_data->type == 7
- || item_data->type == 8); /* Very elegant. */
-
-
- if (stackable)
- *stackable = !must_add_sequentially;
-
- memset(item, 0, sizeof(struct item));
- item->nameid = item_data->nameid;
- item->identify = 1;
-
- return 0;
-}
-
-#define GET_ARG_ITEM(index, dest, stackable) switch(find_item(args, index, &dest, &stackable)) { case -1 : return 1; case 1 : return 0; }
-
static int
op_create_item(env_t *env, int args_nr, val_t *args)
{