still more magic lamp
I was going about the use of tmp_at() from the wrong direction. Instead of trying to replicate how a monster has been displayed, just pick whatever is shown at its location and then redisplay that after it's gone.
This commit is contained in:
+7
-14
@@ -2047,28 +2047,21 @@ void
|
|||||||
mongrantswish(monp)
|
mongrantswish(monp)
|
||||||
struct monst **monp;
|
struct monst **monp;
|
||||||
{
|
{
|
||||||
/* note: `mon' is still valid after mongone() (til next dmonsfree())
|
|
||||||
but it's no longer on the map--affects coordinates and visibility */
|
|
||||||
struct monst *mon = *monp;
|
struct monst *mon = *monp;
|
||||||
int mx = mon->mx, my = mon->my;
|
int mx = mon->mx, my = mon->my,
|
||||||
boolean monspotted = canspotmon(mon),
|
glyph = glyph_at(mx, my);
|
||||||
/* no need to handle Warning since monster is peaceful */
|
|
||||||
disp_hackery = monspotted || Detect_monsters;
|
|
||||||
|
|
||||||
/* remove the monster first in case wish proves to be fatal
|
/* remove the monster first in case wish proves to be fatal
|
||||||
(blasted by artifact), to keep it out of resulting bones file */
|
(blasted by artifact), to keep it out of resulting bones file */
|
||||||
mongone(mon);
|
mongone(mon);
|
||||||
*monp = 0; /* inform caller than monster is gone */
|
*monp = 0; /* inform caller that monster is gone */
|
||||||
/* hide that removal from the player--map is visible during wish prompt */
|
/* hide that removal from player--map is visible during wish prompt */
|
||||||
if (disp_hackery) {
|
tmp_at(DISP_ALWAYS, glyph);
|
||||||
tmp_at(DISP_ALWAYS,
|
tmp_at(mx, my);
|
||||||
monspotted ? mon_to_glyph(mon) : detected_mon_to_glyph(mon));
|
|
||||||
tmp_at(mx, my);
|
|
||||||
}
|
|
||||||
/* grant the wish */
|
/* grant the wish */
|
||||||
makewish();
|
makewish();
|
||||||
/* clean up */
|
/* clean up */
|
||||||
if (disp_hackery) tmp_at(DISP_END, 0);
|
tmp_at(DISP_END, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user