… | |
… | |
478 | * has the AT_MAGIC bit set, and there is a counterwall |
478 | * has the AT_MAGIC bit set, and there is a counterwall |
479 | * on the space, the object doesn't get placed. if immune stop |
479 | * on the space, the object doesn't get placed. if immune stop |
480 | * does not have AT_MAGIC, then counterwalls do not effect the spell. |
480 | * does not have AT_MAGIC, then counterwalls do not effect the spell. |
481 | * |
481 | * |
482 | */ |
482 | */ |
483 | |
|
|
484 | int |
483 | int |
485 | ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop) |
484 | ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop) |
486 | { |
485 | { |
487 | object *tmp; |
486 | if (!xy_normalise (m, x, y)) |
488 | int mflags; |
|
|
489 | maptile *mp; |
|
|
490 | |
|
|
491 | mp = m; |
|
|
492 | mflags = get_map_flags (m, &mp, x, y, &x, &y); |
|
|
493 | |
|
|
494 | if (mflags & P_OUT_OF_MAP) |
|
|
495 | return 0; |
487 | return 0; |
496 | |
488 | |
497 | if (OB_TYPE_MOVE_BLOCK (op, GET_MAP_MOVE_BLOCK (mp, x, y))) |
489 | mapspace &ms = m->at (x, y); |
|
|
490 | |
|
|
491 | if (OB_TYPE_MOVE_BLOCK (op, ms.move_block)) |
498 | return 0; |
492 | return 0; |
499 | |
493 | |
500 | for (tmp = GET_MAP_OB (mp, x, y); tmp != NULL; tmp = tmp->above) |
494 | for (object *tmp = ms.bot; tmp; tmp = tmp->above) |
501 | { |
495 | { |
502 | /* If there is a counterspell on the space, and this |
496 | /* If there is a counterspell on the space, and this |
503 | * object is using magic, don't progress. I believe we could |
497 | * object is using magic, don't progress. I believe we could |
504 | * leave this out and let in progress, and other areas of the code |
498 | * leave this out and let in progress, and other areas of the code |
505 | * will then remove it, but that would seem to to use more |
499 | * will then remove it, but that would seem to to use more |
… | |
… | |
540 | |
534 | |
541 | /* Perhaps we should also put checks in for no magic and unholy |
535 | /* Perhaps we should also put checks in for no magic and unholy |
542 | * ground to prevent it from moving along? |
536 | * ground to prevent it from moving along? |
543 | */ |
537 | */ |
544 | } |
538 | } |
|
|
539 | |
545 | /* If it passes the above tests, it must be OK */ |
540 | /* If it passes the above tests, it must be OK */ |
546 | return 1; |
541 | return 1; |
547 | } |
542 | } |
548 | |
543 | |
549 | /* fire_arch_from_position: fires an archetype. |
544 | /* fire_arch_from_position: fires an archetype. |