summaryrefslogtreecommitdiff
path: root/src/spells4.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-05-27 17:33:59 +0200
committerBardur Arantsson <bardur@scientician.net>2012-05-29 05:37:56 +0200
commit33f06d33cc2f4cd3d36a9616f7f9e9abc7287080 (patch)
tree97754986db36d5d3082cadc92bc6b85c7f30ca9d /src/spells4.c
parent3c6ca071045f3ab2153db833c2be2b500a43880c (diff)
Lua: Add "device_allocation_type" to support moving spells
Diffstat (limited to 'src/spells4.c')
-rw-r--r--src/spells4.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/spells4.c b/src/spells4.c
index ba97e065..e94274a2 100644
--- a/src/spells4.c
+++ b/src/spells4.c
@@ -601,3 +601,21 @@ void spell_description_add_line(s32b spell_idx, cptr line)
{
string_list_append(&school_spells[spell_idx].description, line);
}
+
+void device_allocation_init(device_allocation *device_allocation, byte tval)
+{
+ assert(device_allocation != NULL);
+
+ device_allocation->tval = tval;
+ device_allocation->rarity = 0;
+ range_init(&device_allocation->base_level, 0, 0);
+ range_init(&device_allocation->max_level, 0, 0);
+ device_allocation->next = NULL;
+}
+
+int compare_device_allocation(device_allocation *a, device_allocation *b)
+{
+ return SGLIB_NUMERIC_COMPARATOR(a->tval, b->tval);
+}
+
+SGLIB_DEFINE_LIST_FUNCTIONS(device_allocation, compare_device_allocation, next);