Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions pkg/vere/dawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,18 @@ u3_dawn_vent(u3_noun ship, u3_noun feed, u3_noun* rift)

// (each feed:jael (lest error=term))
//
fed = u3dq("veri:dawn", u3k(ship), u3k(feed), u3k(pot), u3k(liv));
if ( c3__pawn == rank ) {
// comets skip +veri:dawn
fed = u3nc(c3y, u3k(feed));
}
else {
fed = u3dq("veri:dawn", u3k(ship), u3k(feed), u3k(pot), u3k(liv));

if ( c3n == u3h(fed) ) {
// bails, won't return
_dawn_fail(ship, rank, u3t(fed));
return u3_none;
if ( c3n == u3h(fed) ) {
// bails, won't return
_dawn_fail(ship, rank, u3t(fed));
return u3_none;
}
}

u3_assert(c3y == u3du(u3h(u3t(fed))) && u3h(u3h(u3t(fed))) == 2);
Expand Down
31 changes: 25 additions & 6 deletions pkg/vere/king.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,21 @@ _boothack_key(u3_noun kef)
return seed;
}

/* _boothack_is_comet_key(): check if a parsed key is for a comet
*/
static c3_o
_boothack_is_comet_key(u3_noun seed)
{
if ( c3y == u3ud(u3h(seed)) ) {
u3_noun ship = u3h(seed);
u3_noun clan = u3dc("clan:title", ship, u3_nul);
c3_o u3n_is_pawn = (c3__pawn == clan);
u3z(clan);
return u3n_is_pawn;
}
return c3n;
}

/* _boothack_doom(): parse CLI arguments into $doom
*/
static u3_noun
Expand All @@ -770,9 +785,11 @@ _boothack_doom(void)
u3z(whu);
u3z(fak);
}
else if ( 0 != u3_Host.ops_u.who_c ||
else if ( 0 != u3_Host.ops_u.who_c || // -w
( 0 != u3_Host.ops_u.fak_c &&
28 < strlen(u3_Host.ops_u.fak_c) ) ) {
28 < strlen(u3_Host.ops_u.fak_c) ) || // -F comet
0 != u3_Host.ops_u.key_c || // -k
0 != u3_Host.ops_u.gen_c ) { // -G
u3_noun kef;

if ( 0 != u3_Host.ops_u.key_c ) {
Expand Down Expand Up @@ -804,12 +821,14 @@ _boothack_doom(void)
if ( 0 != u3_Host.ops_u.fak_c ) {
bot = u3nc(c3__fake, u3nc(u3_nul, _boothack_key(kef)));
}
else
bot = u3nc(c3__dawn, _boothack_key(kef));
else {
u3_noun seed = _boothack_key(kef);
bot = u3nc(c3__dawn, seed);
}
}
else {
// XX allow parent star to be specified?
//
// if no key is provided, mine a comet with +come:dawn
// XX allow mining under a specified star(s)?
bot = u3nc(c3__come, u3_nul);
}

Expand Down
Loading