Differences From
Artifact [b35b5eeee9]:
207 207 end
208 208
209 209 local wand_cast = function(stack, user, target)
210 210 local meta = stack:get_meta()
211 211 local wand = sorcery.wands.util.getproto(stack)
212 212 if meta:contains('sorcery_wand_spell') == false then return nil end
213 213 local spell = meta:get_string('sorcery_wand_spell')
214 - local castfn = sorcery.data.spells[spell].cast
214 + local spelldata = sorcery.data.spells[spell]
215 +
216 + -- wands don't work in anti-magic fields
217 + local probe = sorcery.spell.probe(user:get_pos())
218 + if probe.disjunction and not spelldata.ignore_disjunction then return nil end
219 +
220 + local castfn = spelldata.cast
215 221 if castfn == nil then return nil end
216 222 local matprops = sorcery.wands.util.matprops(wand)
217 223 if matprops.bond then
218 224 local userct, found = 0, false
219 225 for i=1,matprops.bond do
220 226 local prop = 'bound_user_' .. tostring(i)
221 227 if meta:contains(prop) then
................................................................................
253 259 local context = {
254 260 base = wand;
255 261 stats = matprops;
256 262 meta = meta;
257 263 item = stack;
258 264 caster = user;
259 265 target = target;
266 + probe = probe;
260 267 today = minetest.get_day_count();
261 268 heading = {
262 269 pos = user:get_pos();
263 270 yaw = user:get_look_dir();
264 271 pitch = user:get_look_vertical();
265 272 angle = user:get_look_horizontal();
266 273 eyeheight = uprops.eye_height;