ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/skill_util.C
(Generate patch)

Comparing deliantra/server/server/skill_util.C (file contents):
Revision 1.73 by root, Thu Jan 1 19:42:43 2009 UTC vs.
Revision 1.74 by elmex, Sun Jan 4 16:30:39 2009 UTC

260 */ 260 */
261int 261int
262do_skill (object *op, object *part, object *skill, int dir, const char *string) 262do_skill (object *op, object *part, object *skill, int dir, const char *string)
263{ 263{
264 int success = 0, exp = 0; 264 int success = 0, exp = 0;
265 int did_alc = 0;
266 265
267 if (!skill) 266 if (!skill)
268 return 0; 267 return 0;
269 268
270 /* The code below presumes that the skill points to the object that 269 /* The code below presumes that the skill points to the object that
395 case SK_LITERACY: 394 case SK_LITERACY:
396 case SK_WOODSMAN: 395 case SK_WOODSMAN:
397 /* first, we try to find a cauldron, and do the alchemy thing. 396 /* first, we try to find a cauldron, and do the alchemy thing.
398 * failing that, we go and identify stuff. 397 * failing that, we go and identify stuff.
399 */ 398 */
399 {
400 bool found_cauldron = false;
401
400 for (object *next, *tmp = GET_MAP_OB (op->map, op->x, op->y); tmp; tmp = next) 402 for (object *next, *tmp = GET_MAP_OB (op->map, op->x, op->y); tmp; tmp = next)
401 { 403 {
402 next = tmp->above; 404 next = tmp->above;
403 405
404 if (QUERY_FLAG (tmp, FLAG_IS_CAULDRON)) 406 if (QUERY_FLAG (tmp, FLAG_IS_CAULDRON))
405 { 407 {
408 found_cauldron = true;
409
410 if (tmp->skill != skill->skill)
411 {
412 op->failmsg (format ("You can't use the %s with the %s skill!",
413 query_name (tmp),
414 query_name (skill)));
415 break;
416 }
417
406 attempt_do_alchemy (op, tmp); 418 attempt_do_alchemy (op, tmp, skill);
407 419
408 if (QUERY_FLAG (tmp, FLAG_APPLIED)) 420 if (QUERY_FLAG (tmp, FLAG_APPLIED))
409 esrv_send_inventory (op, tmp); 421 esrv_send_inventory (op, tmp);
410
411 did_alc = 1;
412 } 422 }
413 } 423 }
414 424
415 if (did_alc == 0) 425 if (!found_cauldron)
416 exp = success = skill_ident (op, skill); 426 exp = success = skill_ident (op, skill);
417 427 }
418 break; 428 break;
419 429
420 case SK_DET_MAGIC: 430 case SK_DET_MAGIC:
421 case SK_DET_CURSE: 431 case SK_DET_CURSE:
422 exp = success = skill_ident (op, skill); 432 exp = success = skill_ident (op, skill);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines