… | |
… | |
44 | */ |
44 | */ |
45 | static int |
45 | static int |
46 | did_make_save_item (object *op, int type, object *originator) |
46 | did_make_save_item (object *op, int type, object *originator) |
47 | { |
47 | { |
48 | int i, roll, saves = 0, attacks = 0, number; |
48 | int i, roll, saves = 0, attacks = 0, number; |
49 | materialtype_t *mt; |
49 | materialtype_t *mt = op->material; |
50 | |
|
|
51 | if (!op->materialname) |
|
|
52 | { |
|
|
53 | for (mt = materialt; mt; mt = mt->next) |
|
|
54 | if (op->materials & mt->material) |
|
|
55 | break; |
|
|
56 | } |
|
|
57 | else |
|
|
58 | mt = name_to_material (op->materialname); |
|
|
59 | |
|
|
60 | if (!mt) |
|
|
61 | return TRUE; |
|
|
62 | |
50 | |
63 | roll = rndm (1, 20); |
51 | roll = rndm (1, 20); |
64 | |
52 | |
65 | /* the attacktypes have no meaning for object saves |
53 | /* the attacktypes have no meaning for object saves |
66 | * If the type is only magic, don't adjust type - basically, if |
54 | * If the type is only magic, don't adjust type - basically, if |
… | |
… | |
366 | * that weak walls have is_alive set, which prevent objects from |
354 | * that weak walls have is_alive set, which prevent objects from |
367 | * passing over/through them. We don't care what type of movement |
355 | * passing over/through them. We don't care what type of movement |
368 | * the wall blocks - if it blocks any type of movement, can't be |
356 | * the wall blocks - if it blocks any type of movement, can't be |
369 | * destroyed right now. |
357 | * destroyed right now. |
370 | */ |
358 | */ |
371 | else if (tmp->materialname && op->stats.dam > 0 && !tmp->move_block) |
359 | else if (op->stats.dam > 0 && !tmp->move_block) |
372 | { |
360 | { |
373 | save_throw_object (tmp, type, op); |
361 | save_throw_object (tmp, type, op); |
374 | |
362 | |
375 | if (op->destroyed ()) |
363 | if (op->destroyed ()) |
376 | break; |
364 | break; |