do not allow casting on challenge tasks in v2

This commit is contained in:
Matteo Pagliazzi
2016-05-31 11:13:28 +02:00
parent 6b214e4e3f
commit 87066ef6c7

View File

@@ -657,6 +657,8 @@ api.cast = async function(req, res, next) {
if (!task) {
return res.status(404).json({err: 'Task "' + targetId + '" not found.'});
}
if (task.challenge.id) return res.status(40).json({err: 'Cannot cast spell on challenge task.'});
spell.cast(user, task, req);
await task.save();