Date: Thursday July 20, 2000 @ 20:03 Author: ahn Update of /home/netrek/cvsroot/Vanilla/ntserv In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv23586/ntserv Modified Files: ltd_stats.c Log Message: LTD_TOTAL fixes. **************************************** Index: Vanilla/ntserv/ltd_stats.c diff -u Vanilla/ntserv/ltd_stats.c:1.4 Vanilla/ntserv/ltd_stats.c:1.5 --- Vanilla/ntserv/ltd_stats.c:1.4 Fri Jun 25 16:50:11 1999 +++ Vanilla/ntserv/ltd_stats.c Thu Jul 20 20:03:51 2000 @@ -1,4 +1,4 @@ -/* $Id: ltd_stats.c,v 1.4 1999/06/25 21:50:11 ahn Exp $ +/* $Id: ltd_stats.c,v 1.5 2000/07/21 01:03:51 ahn Exp $ * * Dave Ahn * @@ -77,8 +77,8 @@ /* forced update the LTD_TOTAL slot on demand */ for (race=0; race<LTD_NUM_RACES; race++) { for (ship=1; ship<LTD_NUM_SHIPS; ship++) { - if (ship == LTD_SB) continue; - total += p->p_stats.ltd[race][ship].kills.total; + if (ship != LTD_SB) + total += p->p_stats.ltd[race][ship].kills.total; } p->p_stats.ltd[race][LTD_TOTAL].kills.total = total; } @@ -97,8 +97,8 @@ /* forced update the LTD_TOTAL slot on demand */ for (race=0; race<LTD_NUM_RACES; race++) { for (ship=1; ship<LTD_NUM_SHIPS; ship++) { - if (ship == LTD_SB) continue; - total += p->p_stats.ltd[race][ship].deaths.total; + if (ship != LTD_SB) + total += p->p_stats.ltd[race][ship].deaths.total; } p->p_stats.ltd[race][LTD_TOTAL].deaths.total = total; } @@ -112,20 +112,24 @@ if (s == LTD_TOTAL) { - int race, ship, total = 0; + int race, ship, total = 0, ogg_total = 0; /* forced update the LTD_TOTAL slot on demand */ for (race=0; race<LTD_NUM_RACES; race++) { for (ship=1; ship<LTD_NUM_SHIPS; ship++) { - if (ship == LTD_SB) continue; - total += p->p_stats.ltd[race][ship].bomb.armies; + if (ship != LTD_SB) { + total += p->p_stats.ltd[race][ship].bomb.armies; + ogg_total += p->p_stats.ltd[race][ship].ogged.armies; + } } p->p_stats.ltd[race][LTD_TOTAL].bomb.armies = total; + p->p_stats.ltd[race][LTD_TOTAL].ogged.armies = ogg_total; } } - return (p->p_stats.ltd[ltd_race(p->p_team)][s].bomb.armies); + return (p->p_stats.ltd[ltd_race(p->p_team)][s].bomb.armies + + 5 * p->p_stats.ltd[ltd_race(p->p_team)][s].ogged.armies); } int ltd_planets_taken(struct player *p, LTD_SHIP_T s) { @@ -137,8 +141,8 @@ /* forced update the LTD_TOTAL slot on demand */ for (race=0; race<LTD_NUM_RACES; race++) { for (ship=1; ship<LTD_NUM_SHIPS; ship++) { - if (ship == LTD_SB) continue; - total += p->p_stats.ltd[race][ship].planets.taken; + if (ship != LTD_SB) + total += p->p_stats.ltd[race][ship].planets.taken; } p->p_stats.ltd[race][LTD_TOTAL].planets.taken = total; @@ -150,7 +154,6 @@ int ltd_ticks(struct player *p, LTD_SHIP_T s) { - if (s == LTD_TOTAL) { int race, ship, total = 0; @@ -159,8 +162,8 @@ for (race=0; race<LTD_NUM_RACES; race++) { for (ship=1; ship<LTD_NUM_SHIPS; ship++) { - if (ship == LTD_SB) continue; - total += p->p_stats.ltd[race][ship].ticks.total; + if (ship != LTD_SB) + total += p->p_stats.ltd[race][ship].ticks.total; } p->p_stats.ltd[race][LTD_TOTAL].ticks.total = total; } @@ -180,10 +183,9 @@ for (race=0; race<LTD_NUM_RACES; race++) { for (ship=1; ship<LTD_NUM_SHIPS; ship++) { - if (ship == LTD_SB) continue; - if (p->p_stats.ltd[race][ship].kills.max > max) { - max = p->p_stats.ltd[race][ship].kills.max; - } + if (ship != LTD_SB) + if (p->p_stats.ltd[race][ship].kills.max > max) + max = p->p_stats.ltd[race][ship].kills.max; } p->p_stats.ltd[race][LTD_TOTAL].kills.max = max; }