… | |
… | |
65 | { |
65 | { |
66 | arch_flag = 1; |
66 | arch_flag = 1; |
67 | name_flag = 1; |
67 | name_flag = 1; |
68 | race_flag = 1; |
68 | race_flag = 1; |
69 | } |
69 | } |
|
|
70 | |
70 | /* If the director has race set, only affect objects with a arch, |
71 | /* If the director has race set, only affect objects with a arch, |
71 | * name or race that matches. |
72 | * name or race that matches. |
72 | */ |
73 | */ |
73 | if ((op->race) && |
74 | if ((op->race) && |
74 | ((!(victim->arch && arch_flag && victim->arch->name) || strcmp (op->race, victim->arch->name))) && |
75 | ((!(victim->arch && arch_flag && victim->arch->name) || op->race != victim->arch->name)) && |
75 | ((!(victim->name && name_flag) || strcmp (op->race, victim->name))) && |
76 | ((!(victim->name && name_flag) || op->race != victim->name)) && |
76 | ((!(victim->race && race_flag) || strcmp (op->race, victim->race)))) |
77 | ((!(victim->race && race_flag) || op->race != victim->race))) |
77 | { |
|
|
78 | return 1; |
78 | return 1; |
79 | } |
79 | |
80 | /* If the director has slaying set, only affect objects where none |
80 | /* If the director has slaying set, only affect objects where none |
81 | * of arch, name, or race match. |
81 | * of arch, name, or race match. |
82 | */ |
82 | */ |
83 | if ((op->slaying) && (((victim->arch && arch_flag && victim->arch->name && !strcmp (op->slaying, victim->arch->name))) || |
83 | if ((op->slaying) && (((victim->arch && arch_flag && victim->arch->name && op->slaying == victim->arch->name))) || |
84 | ((victim->name && name_flag && !strcmp (op->slaying, victim->name))) || |
84 | ((victim->name && name_flag && op->slaying == victim->name)) || |
85 | ((victim->race && race_flag && !strcmp (op->slaying, victim->race))))) |
85 | ((victim->race && race_flag && op->slaying == victim->race))) |
86 | { |
|
|
87 | return 1; |
86 | return 1; |
88 | } |
87 | |
89 | return 0; |
88 | return 0; |
90 | } |
89 | } |
91 | |
90 | |
92 | /** |
91 | /** |
93 | * This handles a player dropping money on an altar to identify stuff. |
92 | * This handles a player dropping money on an altar to identify stuff. |
… | |
… | |
422 | int count = 0; |
421 | int count = 0; |
423 | |
422 | |
424 | |
423 | |
425 | if (item == NULL) |
424 | if (item == NULL) |
426 | return 0; |
425 | return 0; |
|
|
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->name, item) == 0) |
431 | { |
431 | { |
… | |
… | |
436 | count++; |
436 | count++; |
437 | else |
437 | else |
438 | count += op->nrof; |
438 | count += op->nrof; |
439 | } |
439 | } |
440 | } |
440 | } |
|
|
441 | |
441 | op = op->below; |
442 | op = op->below; |
442 | } |
443 | } |
|
|
444 | |
443 | return count; |
445 | return count; |
444 | } |
446 | } |
445 | |
447 | |
446 | /** |
448 | /** |
447 | * This removes 'nrof' of what item->slaying says to remove. |
449 | * This removes 'nrof' of what item->slaying says to remove. |
… | |
… | |
2447 | continue; /*Not a valid exit */ |
2449 | continue; /*Not a valid exit */ |
2448 | |
2450 | |
2449 | if ((EXIT_X (tmp) != exit->x) || (EXIT_Y (tmp) != exit->y)) |
2451 | if ((EXIT_X (tmp) != exit->x) || (EXIT_Y (tmp) != exit->y)) |
2450 | continue; /*Not in the same place */ |
2452 | continue; /*Not in the same place */ |
2451 | |
2453 | |
2452 | if (strcmp (exit->map->path, EXIT_PATH (tmp)) != 0) |
2454 | if (exit->map->path != EXIT_PATH (tmp)) |
2453 | continue; /*Not in the same map */ |
2455 | continue; /*Not in the same map */ |
2454 | |
2456 | |
2455 | /* From here we have found the exit is valid. However we do |
2457 | /* From here we have found the exit is valid. However we do |
2456 | * here the check of the exit owner. It is important for the |
2458 | * here the check of the exit owner. It is important for the |
2457 | * town portals to prevent strangers from visiting your appartments |
2459 | * town portals to prevent strangers from visiting your appartments |