| 829 | } |
| 830 | |
| 831 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 832 | |
| 833 | /* |
| 834 | * Called from dighole(); also from do_break_wand() in apply.c |
| 835 | * and do_earthquake() in music.c. |
| 836 | */ |
| 837 | void |
| 838 | liquid_flow( |
| 839 | coordxy x, coordxy y, |
| 840 | schar typ, |
| 841 | struct trap *ttmp, |
| 842 | const char *fillmsg) |
| 843 | { |
| 844 | struct obj *objchain; |
| 845 | struct monst *mon; |
| 846 | boolean u_spot = u_at(x, y); |
| 847 | |
| 848 | /* caller should have changed levl[x][y].typ to POOL, MOAT, or LAVA */ |
| 849 | if (!is_pool_or_lava(x, y)) { |
| 850 | if (iflags.sanity_check) { |
| 851 | impossible("Insane liquid_flow(%d,%d,%s,%s).", x, y, |
| 852 | ttmp ? trapname(ttmp->ttyp, TRUE) : "no trap", |
| 853 | fillmsg ? fillmsg : "no mesg"); |
| 854 | } |
| 855 | return; |
| 856 | } |
| 857 | |
| 858 | if (ttmp) |
| 859 | (void) delfloortrap(ttmp); /* will untrap monster if one is here */ |
| 860 | /* if any objects were frozen here, they're released now */ |
| 861 | obj_ice_effects(x, y, TRUE); |
| 862 | unearth_objs(x, y); |
| 863 | |
| 864 | if (fillmsg) |
| 865 | pline(fillmsg, hliquid(typ == LAVAPOOL ? "lava" : "water")); |
| 866 | /* handle object damage before hero damage; affects potential bones */ |
| 867 | if ((objchain = svl.level.objects[x][y]) != 0) { |
| 868 | if (typ == LAVAPOOL) |
| 869 | fire_damage_chain(objchain, TRUE, TRUE, x, y); |
| 870 | else |
| 871 | water_damage_chain(objchain, TRUE); |
| 872 | } |
| 873 | /* damage to the hero */ |
| 874 | if (u_spot) { |
| 875 | (void) pooleffects(FALSE); |
| 876 | } else if ((mon = m_at(x, y)) != 0) { |
| 877 | (void) minliquid(mon); |
| 878 | } |
| 879 | } |
| 880 | |
| 881 | RESTORE_WARNING_FORMAT_NONLITERAL |
| 882 |
no test coverage detected