[Change] Tweaked fleet adding a little so it seems more natural.
This commit is contained in:
parent
8198a2db77
commit
a3f791e52f
@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
#include "opengl.h"
|
||||
|
||||
/* Font info. */
|
||||
/**
|
||||
* struct glFont
|
||||
*
|
||||
* @brief Represents a font in memory.
|
||||
*/
|
||||
typedef struct glFont_ {
|
||||
int h; /* Height. */
|
||||
int* w;
|
||||
|
16
src/space.c
16
src/space.c
@ -419,9 +419,15 @@ static void space_addFleet(Fleet* fleet, int init) {
|
||||
/* Needed to determine angle. */
|
||||
vectnull(&vn);
|
||||
|
||||
/* c will determin how to create the fleet. */
|
||||
if(init == 1)
|
||||
c = RNG(0, 1);
|
||||
/* c will determine how to create the fleet, only non-zero if it's run in init. */
|
||||
if(init == 1) {
|
||||
if(RNGF() < 0.5) /* 50% chance of starting out en route. */
|
||||
c = 2;
|
||||
else if(RNGF() < 0.5) /* 25% chance of starting out landed. */
|
||||
c = 1;
|
||||
else /* 25% chance starting out entering hyperspace. */
|
||||
c = 0;
|
||||
}
|
||||
else c = 0;
|
||||
|
||||
/* Simulate they came from hyperspace. */
|
||||
@ -430,8 +436,8 @@ static void space_addFleet(Fleet* fleet, int init) {
|
||||
RNG(0,360)*M_PI/180.);
|
||||
}
|
||||
|
||||
/* Starting out landed. */
|
||||
else if(c == 1) {
|
||||
/* Starting out landed or heading towards landing. */
|
||||
else if((c == 1) || (c == 2)) {
|
||||
/* Get friendly planet to land on. */
|
||||
planet = NULL;
|
||||
for(i = 0; i < cur_system->nplanets; i++)
|
||||
|
Loading…
Reference in New Issue
Block a user