summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ghost.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/ghost.cc')
-rw-r--r--crawl-ref/source/ghost.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index 728489b8f2..3535f4c449 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -470,12 +470,17 @@ std::vector<ghost_demon> ghost_demon::find_ghosts()
{
std::vector<ghost_demon> gs;
- ghost_demon player;
- player.init_player_ghost();
- announce_ghost(player);
- gs.push_back(player);
+ if (!you.is_undead)
+ {
+ ghost_demon player;
+ player.init_player_ghost();
+ announce_ghost(player);
+ gs.push_back(player);
+ }
- find_extra_ghosts( gs, n_extra_ghosts() );
+ // Pick up any other ghosts that happen to be on the level if we have space.
+ // If the player is undead, add one to the ghost quota for the level.
+ find_extra_ghosts( gs, n_extra_ghosts() + 1 - gs.size() );
return (gs);
}