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

Comparing deliantra/server/server/apply.C (file contents):
Revision 1.107 by root, Mon May 28 21:28:35 2007 UTC vs.
Revision 1.108 by root, Mon Jun 4 12:19:09 2007 UTC

69 69
70 /* If the director has race set, only affect objects with a arch, 70 /* If the director has race set, only affect objects with a arch,
71 * name or race that matches. 71 * name or race that matches.
72 */ 72 */
73 if ((op->race) && 73 if ((op->race) &&
74 ((!(victim->arch && arch_flag && victim->arch->name) || op->race != victim->arch->name)) && 74 ((!(victim->arch && arch_flag && victim->arch->archname) || op->race != victim->arch->archname)) &&
75 ((!(victim->name && name_flag) || op->race != victim->name)) && 75 ((!(victim->name && name_flag) || op->race != victim->name)) &&
76 ((!(victim->race && race_flag) || op->race != victim->race))) 76 ((!(victim->race && race_flag) || op->race != victim->race)))
77 return 1; 77 return 1;
78 78
79 /* If the director has slaying set, only affect objects where none 79 /* If the director has slaying set, only affect objects where none
80 * of arch, name, or race match. 80 * of arch, name, or race match.
81 */ 81 */
82 if ((op->slaying) && (((victim->arch && arch_flag && victim->arch->name && op->slaying == victim->arch->name))) || 82 if ((op->slaying) && (((victim->arch && arch_flag && victim->arch->archname && op->slaying == victim->arch->archname))) ||
83 ((victim->name && name_flag && op->slaying == victim->name)) || 83 ((victim->name && name_flag && op->slaying == victim->name)) ||
84 ((victim->race && race_flag && op->slaying == victim->race))) 84 ((victim->race && race_flag && op->slaying == victim->race)))
85 return 1; 85 return 1;
86 86
87 return 0; 87 return 0;
425 return 0; 425 return 0;
426 426
427 op = op->below; 427 op = op->below;
428 while (op != NULL) 428 while (op != NULL)
429 { 429 {
430 if (strcmp (op->arch->name, item) == 0) 430 if (strcmp (op->arch->archname, item) == 0)
431 { 431 {
432 if (!QUERY_FLAG (op, FLAG_CURSED) && !QUERY_FLAG (op, FLAG_DAMNED) 432 if (!QUERY_FLAG (op, FLAG_CURSED) && !QUERY_FLAG (op, FLAG_DAMNED)
433 /* Loophole bug? -FD- */ && !QUERY_FLAG (op, FLAG_UNPAID)) 433 /* Loophole bug? -FD- */ && !QUERY_FLAG (op, FLAG_UNPAID))
434 { 434 {
435 if (op->nrof == 0) /* this is necessary for artifact sacrifices --FD-- */ 435 if (op->nrof == 0) /* this is necessary for artifact sacrifices --FD-- */
459 prev = op; 459 prev = op;
460 op = op->below; 460 op = op->below;
461 461
462 while (op != NULL) 462 while (op != NULL)
463 { 463 {
464 if (strcmp (op->arch->name, item) == 0) 464 if (strcmp (op->arch->archname, item) == 0)
465 { 465 {
466 if (op->nrof >= nrof) 466 if (op->nrof >= nrof)
467 { 467 {
468 decrease_ob_nr (op, nrof); 468 decrease_ob_nr (op, nrof);
469 return; 469 return;
944 944
945 price_in = cost * item->value; 945 price_in = cost * item->value;
946 } 946 }
947 else 947 else
948 { 948 {
949 if (item->type == PLAYER || CONV_FROM (converter) != item->arch->name || 949 if (item->type == PLAYER || CONV_FROM (converter) != item->arch->archname ||
950 (CONV_NEED (converter) && CONV_NEED (converter) > (uint16) item->nrof)) 950 (CONV_NEED (converter) && CONV_NEED (converter) > (uint16) item->nrof))
951 return 0; 951 return 0;
952 952
953 if (CONV_NEED (converter)) 953 if (CONV_NEED (converter))
954 { 954 {
1311 * proper. This code was causing needless crashes. 1311 * proper. This code was causing needless crashes.
1312 */ 1312 */
1313 if (recursion_depth >= 500) 1313 if (recursion_depth >= 500)
1314 { 1314 {
1315 LOG (llevDebug, "WARNING: move_apply(): aborting recursion " 1315 LOG (llevDebug, "WARNING: move_apply(): aborting recursion "
1316 "[trap arch %s, name %s; victim arch %s, name %s]\n", &trap->arch->name, &trap->name, &victim->arch->name, &victim->name); 1316 "[trap arch %s, name %s; victim arch %s, name %s]\n", &trap->arch->archname, &trap->name, &victim->arch->archname, &victim->name);
1317 return; 1317 return;
1318 } 1318 }
1319 recursion_depth++; 1319 recursion_depth++;
1320 if (trap->head) 1320 if (trap->head)
1321 trap = trap->head; 1321 trap = trap->head;
1518 } 1518 }
1519 goto leave; 1519 goto leave;
1520 1520
1521 default: 1521 default:
1522 LOG (llevDebug, "name %s, arch %s, type %d with fly/walk on/off not " 1522 LOG (llevDebug, "name %s, arch %s, type %d with fly/walk on/off not "
1523 "handled in move_apply()\n", &trap->name, &trap->arch->name, trap->type); 1523 "handled in move_apply()\n", &trap->name, &trap->arch->archname, trap->type);
1524 goto leave; 1524 goto leave;
1525 } 1525 }
1526 1526
1527leave: 1527leave:
1528 recursion_depth--; 1528 recursion_depth--;
2027 shstr_cmp dragon_ability_force ("dragon_ability_force"); 2027 shstr_cmp dragon_ability_force ("dragon_ability_force");
2028 shstr_cmp dragon_skin_force ("dragon_skin_force"); 2028 shstr_cmp dragon_skin_force ("dragon_skin_force");
2029 2029
2030 for (tmp = op->inv; tmp; tmp = tmp->below) 2030 for (tmp = op->inv; tmp; tmp = tmp->below)
2031 if (tmp->type == FORCE) 2031 if (tmp->type == FORCE)
2032 if (tmp->arch->name == dragon_skin_force) 2032 if (tmp->arch->archname == dragon_skin_force)
2033 skin = tmp; 2033 skin = tmp;
2034 else if (tmp->arch->name == dragon_ability_force) 2034 else if (tmp->arch->archname == dragon_ability_force)
2035 abil = tmp; 2035 abil = tmp;
2036 2036
2037 /* if either skin or ability are missing, this is an old player 2037 /* if either skin or ability are missing, this is an old player
2038 which is not to be considered a dragon -> bail out */ 2038 which is not to be considered a dragon -> bail out */
2039 if (skin == NULL || abil == NULL) 2039 if (skin == NULL || abil == NULL)
3945 { 3945 {
3946 new_draw_info_format (NDI_UNIQUE, 0, pl, "You can't use the %s with your %s!", query_name (transformer), query_name (marked)); 3946 new_draw_info_format (NDI_UNIQUE, 0, pl, "You can't use the %s with your %s!", query_name (transformer), query_name (marked));
3947 return; 3947 return;
3948 } 3948 }
3949 /* check whether they are compatible or not */ 3949 /* check whether they are compatible or not */
3950 find = strstr (marked->slaying, transformer->arch->name); 3950 find = strstr (marked->slaying, transformer->arch->archname);
3951 if (!find || (*(find + strlen (transformer->arch->name)) != ':')) 3951 if (!find || (*(find + strlen (transformer->arch->archname)) != ':'))
3952 { 3952 {
3953 new_draw_info_format (NDI_UNIQUE, 0, pl, "You can't use the %s with your %s!", query_name (transformer), query_name (marked)); 3953 new_draw_info_format (NDI_UNIQUE, 0, pl, "You can't use the %s with your %s!", query_name (transformer), query_name (marked));
3954 return; 3954 return;
3955 } 3955 }
3956 find += strlen (transformer->arch->name) + 1; 3956 find += strlen (transformer->arch->archname) + 1;
3957 /* Item can be used, now find how many and what it yields */ 3957 /* Item can be used, now find how many and what it yields */
3958 if (isdigit (*(find))) 3958 if (isdigit (*(find)))
3959 { 3959 {
3960 yield = atoi (find); 3960 yield = atoi (find);
3961 if (yield < 1) 3961 if (yield < 1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines