merge grenadier/aurhat commits curated by BrutalSystem (issue #375)

This commit is contained in:
flowtron
2021-06-25 09:32:35 +02:00
parent 783c7efa52
commit b13fcaf3e3
14 changed files with 258 additions and 148 deletions
+11 -10
View File
@@ -188,17 +188,18 @@ int closestent() // used for delent and edit mode ent display
bdist = dist;
}
}
}
if(best >= 0)
{ // if closest ent shares location with other ents, pick one with clentsel
vector<int> bs;
loopv(ents)
{
entity &e = ents[i];
if(!(enttypemask & (1 << e.type))) continue;
if(ents[best].x == e.x && ents[best].y == e.y && ents[best].z == e.z) bs.add(i);
if(best >= 0)
{ // if closest ent shares location with other ents, pick one with clentsel
vector<int> bs;
loopv(ents)
{
entity &e = ents[i];
if(!(enttypemask & (1 << e.type))) continue;
if(ents[best].x == e.x && ents[best].y == e.y && ents[best].z == e.z) bs.add(i);
}
best = bs[(clentsel %= bs.length())];
}
best = bs[(clentsel %= bs.length())];
}
return best;
}