1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-28 02:55:15 +00:00

Merge pull request #441 from josephcsible/outlaworbdiscord

Stop Outlaws from shooting themselves when Orb of Discord is active
This commit is contained in:
Zeno Rogue
2025-09-07 10:13:13 +02:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -1194,6 +1194,7 @@ EX vector<cell*> 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;
}

View File

@@ -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; i<isize(lst); i++) lst[i]->listindex = tmps[i];
}