Fix der NMR-Berechnung

This commit is contained in:
Enno Rehling 2006-08-20 16:23:46 +00:00
parent 45fad69789
commit ae41442b01
2 changed files with 10 additions and 7 deletions

View File

@ -171,6 +171,7 @@ update_nmrs(void)
{
int i, newplayers =0;
faction *f;
int turn = global.data_turn;
if (nmrs==NULL) nmrs = malloc(sizeof(int)*(NMRTimeout()+1));
for (i = 0; i <= NMRTimeout(); ++i) {
@ -181,7 +182,7 @@ update_nmrs(void)
if (fval(f, FFL_ISNEW)) {
++newplayers;
} else if (f->no != MONSTER_FACTION) {
int nmr = turn-f->lastorders;
int nmr = turn-f->lastorders+1;
if (nmr<0 || nmr>NMRTimeout()) {
log_error(("faction %s has %d NMRS\n", factionid(f), nmr));
nmr = max(0, nmr);

View File

@ -62,12 +62,6 @@ function process(orders)
print("could not read " .. orders)
return -1
end
nmrs = get_nmrs(1)
if nmrs >= 60 then
print("Shit. More than 60 factions with 1 NMR (" .. nmrs .. ")")
return -1
end
print (nmrs .. " Factions with 1 NMR")
run_scripts()
-- create new monsters:
@ -77,6 +71,14 @@ function process(orders)
spawn_ents()
plan_monsters()
local nmrs = get_nmrs(1)
if nmrs >= 60 then
print("Shit. More than 60 factions with 1 NMR (" .. nmrs .. ")")
return -1
end
print (nmrs .. " Factions with 1 NMR")
process_orders()
-- post-turn updates: