Make the "crystals' member into an enumeration.
[super-star-trek.git] / src / setup.c
index 8bbafbc31e539f43fd0b7927979a31af22f303e7..741f35f00016b627ab1fef2bed17e75f6d0364fd 100644 (file)
@@ -324,7 +324,8 @@ void setup(bool needprompt)
                   game.state.galaxy[w.x][w.y].klingons > 8);
            // check for duplicate
            for (j = 1; j < i; j++)
-               if (game.state.kcmdr[j].x==w.x && game.state.kcmdr[j].y==w.y) break;
+               if (same(game.state.kcmdr[j], w))
+                   break;
        } while (j < i);
        game.state.galaxy[w.x][w.y].klingons++;
        game.state.kcmdr[i] = w;
@@ -336,12 +337,12 @@ void setup(bool needprompt)
        game.state.plnets[i].w = w;
        if (i < NINHAB) {
            game.state.plnets[i].pclass = M;    // All inhabited planets are class M
-           game.state.plnets[i].crystals = 0;
+           game.state.plnets[i].crystals = absent;
            game.state.plnets[i].known = known;
            game.state.plnets[i].inhabited = i;
        } else {
            game.state.plnets[i].pclass = Rand()*3.0; // Planet class M N or O
-           game.state.plnets[i].crystals = 1.5*Rand();         // 1 in 3 chance of crystals
+           game.state.plnets[i].crystals = Rand()*1.5;         // 1 in 3 chance of crystals
            game.state.plnets[i].known = unknown;
            game.state.plnets[i].inhabited = UNINHABITED;
        }