From ac25058b50a829c39612d87f05c208718496bea3 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Fri, 18 Nov 2005 23:23:04 +0000 Subject: [PATCH] (prod_nat): Remove non-functional aging code for nat_contact. Remove nat_contact debugging from server log. (update_main, prod_nat): Move aging code for nat_contact from update_main to prod_nat. --- src/lib/update/main.c | 7 ------- src/lib/update/nat.c | 13 +++++-------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/lib/update/main.c b/src/lib/update/main.c index c1ebf886..6fb6957f 100644 --- a/src/lib/update/main.c +++ b/src/lib/update/main.c @@ -179,13 +179,6 @@ update_main(void *unused) } } } - /* Age contact */ - if (opt_LOSE_CONTACT) { - for (cn = 1; cn < MAXNOC; cn++) { - if ((cnp = getnatp(cn)) != NULL) - agecontact(cnp); - } - } /* Only update mobility for non-MOB_ACCESS here, since it doesn't get done for MOB_ACCESS anyway during the update */ if (!opt_MOB_ACCESS) { diff --git a/src/lib/update/nat.c b/src/lib/update/nat.c index d213e5e0..2af5b8f8 100644 --- a/src/lib/update/nat.c +++ b/src/lib/update/nat.c @@ -134,7 +134,8 @@ prod_nat(int etu) double res[MAXNOC]; double newvalue; natid n; - int cn, cont; + int cn; + struct natstr *cnp; for (n = 0; NULL != (np = getnatp(n)); n++) { if ((np->nat_stat & STAT_NORM) == 0) @@ -215,13 +216,9 @@ prod_nat(int etu) wu((natid)0, n, "money delta was $%ld for this update\n", np->nat_money - money[n]); if (opt_LOSE_CONTACT) { - for (cn = 0; cn <= MAXNOC; cn++) { - cont = getcontact(np, cn); - if (cont > 0) { - logerror("country %d at level %d with country %d.\n", - n, cont, cn); - setcont(n, cn, cont - 1); - } + for (cn = 1; cn < MAXNOC; cn++) { + if ((cnp = getnatp(cn)) != NULL) + agecontact(cnp); } } }