iqx = quadx+(lookx+(QUADSIZE-1))/QUADSIZE - 1;
iqy = quady+(looky+(QUADSIZE-1))/QUADSIZE - 1;
if (iqx < 1 || iqx > GALSIZE || iqy < 1 || iqy > GALSIZE ||
iqx = quadx+(lookx+(QUADSIZE-1))/QUADSIZE - 1;
iqy = quady+(looky+(QUADSIZE-1))/QUADSIZE - 1;
if (iqx < 1 || iqx > GALSIZE || iqy < 1 || iqy > GALSIZE ||
return 0; /* no can do -- neg energy, supernovae, or >8 Klingons */
if (ienm == IHR) return 0; /* Romulans cannot escape! */
if (irun == 0) {
return 0; /* no can do -- neg energy, supernovae, or >8 Klingons */
if (ienm == IHR) return 0; /* Romulans cannot escape! */
if (irun == 0) {
if (flag) {
/* Avoid quadrants with bases if we want to avoid Enterprise */
for (i = 1; i <= game.state.rembase; i++)
if (flag) {
/* Avoid quadrants with bases if we want to avoid Enterprise */
for (i = 1; i <= game.state.rembase; i++)
ibqy = game.state.baseqy[i];
if ((ibqx == quadx && ibqy == quady) ||
(ibqx == batx && ibqy == baty) ||
ibqy = game.state.baseqy[i];
if ((ibqx == quadx && ibqy == quady) ||
(ibqx == batx && ibqy == baty) ||
/* if there is a commander, an no other base is appropriate,
we will take the one with the commander */
for (j = 1; j <= game.state.remcom; j++) {
/* if there is a commander, an no other base is appropriate,
we will take the one with the commander */
for (j = 1; j <= game.state.remcom; j++) {