[Change] Tweaked fleet adding a little so it seems more natural.

This commit is contained in:
Allanis 2013-10-15 00:31:55 +01:00
parent 8198a2db77
commit a3f791e52f
2 changed files with 16 additions and 6 deletions

View File

@ -1,7 +1,11 @@
#pragma once #pragma once
#include "opengl.h" #include "opengl.h"
/* Font info. */ /**
* struct glFont
*
* @brief Represents a font in memory.
*/
typedef struct glFont_ { typedef struct glFont_ {
int h; /* Height. */ int h; /* Height. */
int* w; int* w;

View File

@ -419,9 +419,15 @@ static void space_addFleet(Fleet* fleet, int init) {
/* Needed to determine angle. */ /* Needed to determine angle. */
vectnull(&vn); vectnull(&vn);
/* c will determin how to create the fleet. */ /* c will determine how to create the fleet, only non-zero if it's run in init. */
if(init == 1) if(init == 1) {
c = RNG(0, 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; else c = 0;
/* Simulate they came from hyperspace. */ /* Simulate they came from hyperspace. */
@ -430,8 +436,8 @@ static void space_addFleet(Fleet* fleet, int init) {
RNG(0,360)*M_PI/180.); RNG(0,360)*M_PI/180.);
} }
/* Starting out landed. */ /* Starting out landed or heading towards landing. */
else if(c == 1) { else if((c == 1) || (c == 2)) {
/* Get friendly planet to land on. */ /* Get friendly planet to land on. */
planet = NULL; planet = NULL;
for(i = 0; i < cur_system->nplanets; i++) for(i = 0; i < cur_system->nplanets; i++)