diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-07 20:32:48 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-07 20:32:48 +1000 |
commit | d351be2e9887f5b66b49f15e8117f07ceb54a0de (patch) | |
tree | 1d284395813e16af9e4a1083b4e30c2bc775d75b /crawl-ref/source/dat/clua | |
parent | 7a869a2b8fa07f329376019d4846455ba7580939 (diff) | |
download | crawl-ref-d351be2e9887f5b66b49f15e8117f07ceb54a0de.tar.gz crawl-ref-d351be2e9887f5b66b49f15e8117f07ceb54a0de.zip |
Make TriggerableFunction's data parameter always a table.
And make it use lmark.marshall_table and lmark.unmarshall_table instead.
Diffstat (limited to 'crawl-ref/source/dat/clua')
-rw-r--r-- | crawl-ref/source/dat/clua/lm_trig.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/dat/clua/lm_trig.lua b/crawl-ref/source/dat/clua/lm_trig.lua index 265c7b2245..58ae2d4934 100644 --- a/crawl-ref/source/dat/clua/lm_trig.lua +++ b/crawl-ref/source/dat/clua/lm_trig.lua @@ -371,14 +371,14 @@ function TriggerableFunction:new(pars) tf.func = pars.func tf.repeated = pars.repeated - tf.data = pars.data + tf.data = pars.data or {} tf.props = pars.props or {} return tf end function TriggerableFunction:on_trigger(triggerer, marker, ev) - self.func(data, self, triggerer, marker, ev) + self.func(self.data, self, triggerer, marker, ev) if not self.repeated then self:remove(marker) @@ -390,7 +390,7 @@ function TriggerableFunction:write(marker, th) file.marshall(th, self.func) file.marshall_meta(th, self.repeated) - file.marshall_meta(th, self.data) + lmark.marshall_table(th, self.data) end function TriggerableFunction:read(marker, th) @@ -398,7 +398,7 @@ function TriggerableFunction:read(marker, th) self.func = file.unmarshall_fn(th) self.repeated = file.unmarshall_meta(th) - self.data = file.unmarshall_meta(th) + self.data = lmark.unmarshall_table(th) setmetatable(self, TriggerableFunction) |