summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgnmon.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-01-05 11:15:29 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-01-05 14:29:45 +0100
commit834bc442d6f42102ed56b6a29a6cf478600846be (patch)
tree5994b0f1b407d64a2593dd1847231159e168c339 /crawl-ref/source/l_dgnmon.cc
parent304935764147db0e85bdcfa5604e501ee81b5bf3 (diff)
downloadcrawl-ref-834bc442d6f42102ed56b6a29a6cf478600846be.tar.gz
crawl-ref-834bc442d6f42102ed56b6a29a6cf478600846be.zip
Make dgn_place_monster() return monster*
This is what most uses want. Only left with mindex() is to_respawn[] in the arena, no idea what it is needed for.
Diffstat (limited to 'crawl-ref/source/l_dgnmon.cc')
-rw-r--r--crawl-ref/source/l_dgnmon.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/crawl-ref/source/l_dgnmon.cc b/crawl-ref/source/l_dgnmon.cc
index 3aa6484b4a..4f12cd2b86 100644
--- a/crawl-ref/source/l_dgnmon.cc
+++ b/crawl-ref/source/l_dgnmon.cc
@@ -209,11 +209,10 @@ static int dgn_create_monster(lua_State *ls)
for (int i = 0, size = mlist.size(); i < size; ++i)
{
mons_spec mspec = mlist.get_monster(i);
- const int idx = dgn_place_monster(mspec, you.absdepth0, c,
- false, false, false);
- if (idx != -1)
+ if (monster *mon = dgn_place_monster(mspec, you.absdepth0, c,
+ false, false, false))
{
- push_monster(ls, &menv[idx]);
+ push_monster(ls, mon);
return (1);
}
}