delete dead code.

This commit is contained in:
Enno Rehling 2017-12-08 20:27:43 +01:00
parent 5192ffdb60
commit 26c31708dc
4 changed files with 5 additions and 84 deletions

View file

@ -124,30 +124,6 @@ static void terraform_default(struct rawmaterial *res, const region * r)
UNUSED_ARG(r); UNUSED_ARG(r);
} }
#ifdef RANDOM_CHANGE
static void resource_random_change(int *pvalue, bool used)
{
int split = 5;
int rnd = rng_int() % 100;
if (pvalue == 0 || rnd % 10 >= 10)
return;
if (used)
split = 4;
/* if a resource was mined this round, there is a 6% probability
* of a decline and a 4% probability of a raise. */
/* if it wasn't mined this round, there is an equal probability
* of 5% for a decline or a raise. */
if (rnd < split) {
(*pvalue)++;
} else {
(*pvalue)--;
}
if ((*pvalue) < 0)
(*pvalue) = 0;
}
#endif
static int visible_default(const rawmaterial * res, int skilllevel) static int visible_default(const rawmaterial * res, int skilllevel)
/* resources are visible, if skill equals minimum skill to mine them /* resources are visible, if skill equals minimum skill to mine them
* plus current level of difficulty */ * plus current level of difficulty */

View file

@ -102,30 +102,6 @@ int firstx = 0, firsty = 0;
/* TODO: is this still important? */ /* TODO: is this still important? */
int enc_gamedata = ENCODING_UTF8; int enc_gamedata = ENCODING_UTF8;
/* local symbols */
static region *current_region;
char *rns(FILE * f, char *c, size_t size)
{
char *s = c;
do {
*s = (char)getc(f);
} while (*s != '"');
for (;;) {
*s = (char)getc(f);
if (*s == '"')
break;
if (s < c + size)
++s;
}
*s = 0;
return c;
}
int maxregions = -1;
int loadplane = 0;
static void read_alliances(gamedata *data) static void read_alliances(gamedata *data)
{ {
storage *store = data->store; storage *store = data->store;
@ -635,7 +611,6 @@ static region *readregion(gamedata *data, int x, int y)
} }
else { else {
assert(uid == 0 || r->uid == uid); assert(uid == 0 || r->uid == uid);
current_region = r;
while (r->attribs) while (r->attribs)
a_remove(&r->attribs, r->attribs); a_remove(&r->attribs, r->attribs);
if (r->land) { if (r->land) {
@ -1399,7 +1374,6 @@ int read_game(gamedata *data)
building **bp; building **bp;
ship **shp; ship **shp;
unit *u; unit *u;
int rmax = maxregions;
storage * store = data->store; storage * store = data->store;
const struct building_type *bt_lighthouse = bt_find("lighthouse"); const struct building_type *bt_lighthouse = bt_find("lighthouse");
const struct race *rc_spell = rc_find("spell"); const struct race *rc_spell = rc_find("spell");
@ -1443,11 +1417,9 @@ int read_game(gamedata *data)
/* Regionen */ /* Regionen */
READ_INT(store, &nread); READ_INT(store, &nread);
assert(nread < MAXREGIONS && nread>=0); assert(nread < MAXREGIONS && nread >=0);
if (rmax < 0) {
rmax = nread; log_debug(" - Einzulesende Regionen: %d", nread);
}
log_debug(" - Einzulesende Regionen: %d/%d", rmax, nread);
while (--nread >= 0) { while (--nread >= 0) {
unit **up; unit **up;
@ -1510,7 +1482,6 @@ int read_game(gamedata *data)
update_interval(u->faction, r); update_interval(u->faction, r);
} }
} }
--rmax;
} }
read_borders(data); read_borders(data);
@ -1572,9 +1543,6 @@ int read_game(gamedata *data)
fix_familiars(); fix_familiars();
} }
if (loadplane || maxregions >= 0) {
remove_empty_factions();
}
log_debug("Done loading turn %d.", turn); log_debug("Done loading turn %d.", turn);
return 0; return 0;

View file

@ -1764,10 +1764,9 @@ static void sail(unit * u, order * ord, region_list ** routep, bool drifting)
} }
if (!flying_ship(sh)) { if (!flying_ship(sh)) {
int stormchance = 0;
int reason;
if (storms_enabled) { if (storms_enabled) {
int stormyness; int stormchance = 0;
int stormyness, reason;
gamedate date; gamedate date;
get_gamedate(turn, &date); get_gamedate(turn, &date);
stormyness = storms ? storms[date.month] * 5 : 0; stormyness = storms ? storms[date.month] * 5 : 0;

View file

@ -4527,28 +4527,6 @@ int sp_illusionary_shapeshift(castorder * co)
return cast_level; return cast_level;
} }
/* ------------------------------------------------------------- */
/* Name: Regionstraum analysieren
* Stufe: 9
* Aura: 18
* Kosten: SPC_FIX
* Wirkung:
* Zeigt die Verzauberungen eines Objekts an (curse->name,
* curse::info). Aus der Differenz Spruchstaerke und Curse->vigour
* ergibt sich die Chance den Spruch zu identifizieren ((force -
* c->vigour)*10 + 100 %).
*/
int sp_analyseregionsdream(castorder * co)
{
region *r = co_get_region(co);
unit *mage = co->magician.u;
int cast_level = co->level;
magicanalyse_region(r, mage, cast_level);
return cast_level;
}
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* Name: Traumbilder erkennen /* Name: Traumbilder erkennen
* Stufe: 5 * Stufe: 5