diff --git a/src/space.c b/src/space.c index a281ee7..e7f947d 100644 --- a/src/space.c +++ b/src/space.c @@ -219,6 +219,7 @@ char** space_getFactionPlanet(int* nplanets, int* factions, int nfactions) { tmp = realloc(tmp, sizeof(char*) * mtmp); } tmp[ntmp-1] = planet->name; + break; // No need to check all factions. } } (*nplanets) = ntmp; diff --git a/src/spfx.c b/src/spfx.c index 1989943..bf14da3 100644 --- a/src/spfx.c +++ b/src/spfx.c @@ -147,7 +147,7 @@ void spfx_clear(void) { static void spfx_destroy(SPFX* layer, int* nlayer, int spfx) { (*nlayer)--; - memmove(&layer[spfx], &layer[spfx+1], (*nlayer-spfx-1)*sizeof(SPFX)); + memmove(&layer[spfx], &layer[spfx+1], (*nlayer-spfx)*sizeof(SPFX)); } void spfx_update(const double dt) {