summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ghost.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-20 13:28:43 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-20 13:28:43 +0000
commite57ab785ed42435069db2f2397fe939a70119c27 (patch)
tree1462ef758ec81c636d670c6590a0a614606b2de6 /crawl-ref/source/ghost.cc
parent2eadd5f7cdf3ce07ea680f7651f482a26fd62624 (diff)
downloadcrawl-ref-e57ab785ed42435069db2f2397fe939a70119c27.tar.gz
crawl-ref-e57ab785ed42435069db2f2397fe939a70119c27.zip
Save existing ghosts back to bones file even if player is undead.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6620 c06c8d41-db1a-0410-9941-cceddc491573
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);
}