diff --git a/attack.cpp b/attack.cpp index c1b968df..4d01f20f 100644 --- a/attack.cpp +++ b/attack.cpp @@ -1194,6 +1194,7 @@ EX vector gun_targets(cell *c) { if(passable(c2, c1, P_BULLET | P_FLYING | P_MONSTER)) if(cl.add(c2)) dists.push_back(dists[i] + 1); } + cl.remove(c); return cl.lst; } diff --git a/locations.cpp b/locations.cpp index 71f3bb71..d27a5991 100644 --- a/locations.cpp +++ b/locations.cpp @@ -413,6 +413,16 @@ struct manual_celllister { return true; } + /** \brief remove a cell from the list */ + bool remove(cell *c) { + if(!listed(c)) return false; + int i = c->listindex; + c->listindex = tmps[i]; + tmps.erase(tmps.begin() + i); + lst.erase(lst.begin() + i); + return true; + } + ~manual_celllister() { for(int i=0; ilistindex = tmps[i]; }