1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-08-30 01:07:57 +00:00

created a function init_heptagon which does tailored_alloc and clears the data

This commit is contained in:
Zeno Rogue
2021-07-04 10:36:16 +02:00
parent adb9bd75ee
commit 74486309a6
13 changed files with 37 additions and 121 deletions

View File

@@ -24,13 +24,11 @@ EX namespace inforder {
heptagon *create_step(heptagon *h, int direction) {
int deg = h->type;
if(mixed()) deg = 7 - deg;
auto h1 = tailored_alloc<heptagon> (deg);
auto h1 = init_heptagon(deg);
bool par = h->s == hsA && direction == 0;
h->c.connect(direction, h1, par ? 1 + hrand(2) : 0, false);
h1->alt = NULL;
h1->s = hsA;
h1->cdata = NULL;
h1->distance = h->distance + (par ? -1 : 1);
h1->c7 = newCell(deg, h1);