From 3ca1a267b054daff545e113cbb29149e04c58abd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 21 Aug 2004 01:55:56 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/bug=5Fview=5Fpage.?= =?UTF-8?q?php=3Fbug=5Fid=3D0000215=20D=C3=A4monenhunger=20halbiert=20Tale?= =?UTF-8?q?nte=20nicht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000217 Falsche Trefferzählung http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000216 Bauernblutverteilung http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000206 (Alles) im diplomatiestatus http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000200 VERKAUFEN ALLES berücksichtigt keine Karawanserei --- src/common/gamecode/economy.c | 4 +++- src/common/gamecode/laws.c | 31 +++++++++++++------------------ src/common/gamecode/report.c | 2 +- src/common/kernel/battle.c | 18 ++++++++++-------- src/common/kernel/combatspells.c | 4 ++-- src/common/kernel/eressea.h | 2 +- src/common/kernel/movement.c | 2 +- 7 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 3a6fa6a82..8f8487eba 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -2941,7 +2941,7 @@ produce(void) case K_SELL: /* sell returns true if the sale is not limited * by the region limit */ - limited = !sell(u, &sellorders, ord) & limited; + limited &= !sell(u, &sellorders, ord); break; } } @@ -3027,6 +3027,8 @@ produce(void) if (sellorders) { int limit = rpeasants(r) / TRADE_FRACTION; + if (rterrain(r) == T_DESERT && buildingtype_exists(r, bt_find("caravan"))) + limit *= 2; expandselling(r, sellorders, limited?limit:INT_MAX); } diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 936e78756..56fd46048 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -166,7 +166,6 @@ get_food(region *r) { unit *u; int peasantfood = rpeasants(r)*10; - unit * demon = r->units; /* 1. Versorgung von eigenen Einheiten. Das vorhandene Silber * wird zunächst so auf die Einheiten aufgeteilt, dass idealerweise @@ -238,33 +237,27 @@ get_food(region *r) */ for (u = r->units; u; u = u->next) { if (u->race == new_race[RC_DAEMON]) { + unit * donor = r->units; int hungry = u->number; - while (demon!=NULL && hungry>0) { + while (donor!=NULL && hungry>0) { /* alwayy start with the first known uint that may have some blood */ static const struct potion_type * pt_blood; - unit * ud = demon; if (pt_blood==NULL) pt_blood = pt_find("peasantblood"); - demon = NULL; /* this will be re-set in the loop */ - while (ud!=NULL) { - if (ud->race==new_race[RC_DAEMON]) { - if (get_effect(ud, pt_blood)) { - /* new best guess for first blood-donor: */ - if (demon==NULL) demon = ud; + while (donor!=NULL) { + if (donor->race==new_race[RC_DAEMON]) { + if (get_effect(donor, pt_blood)) { /* if he's in our faction, drain him: */ - if (ud->faction==u->faction) break; + if (donor->faction==u->faction) break; } } - ud=ud->next; + donor = donor->next; } - if (ud!=NULL) { - int blut = get_effect(ud, pt_blood); + if (donor != NULL) { + int blut = get_effect(donor, pt_blood); blut = min(blut, hungry); - change_effect(ud, pt_blood, -blut); + change_effect(donor, pt_blood, -blut); hungry -= blut; - } else { - break; - /* no more help for us */ } } if (r->planep == NULL || !fval(r->planep, PFL_NOFEED)) { @@ -276,7 +269,9 @@ get_food(region *r) peasantfood = 0; } if (hungry > 0) { - hunger(hungry, u); /* nicht gefütterte dämonen hungern */ + /* nicht gefütterte dämonen hungern */ + if (hunger(hungry, u)) fset(u, UFL_HUNGER); + /* used to be: hunger(hungry, u); */ } } } diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index e3219ee9f..a81669229 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -1690,7 +1690,7 @@ show_allies(const faction * f, const ally * allies) hh = 0; scat(factionname(sf->faction)); scat(" ("); - if (mode == HELP_ALL) { + if ((mode & HELP_ALL) == HELP_ALL) { scat("Alles"); } else for (h = 1; h < HELP_ALL; h *= 2) { diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 14f81154f..66eeb9db6 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -994,7 +994,11 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile) boolean magic = false; int da = dice_rand(damage); - if(fval(au, UFL_WERE)) { +#ifdef SHOW_KILLS + ++at.fighter->hits; +#endif + + if (fval(au, UFL_WERE)) { int level = fspecial(du->faction, FS_LYCANTROPE); da += level; } @@ -1188,13 +1192,14 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile) return false; } #ifdef SHOW_KILLS - ++at.fighter->kills; + ++at.fighter->kills; + assert(at.fighter->kills>=at.fighter->hits); #endif #ifdef SMALL_BATTLE_MESSAGES - if (b->small) { - strcat(smallbuf, ", die tödlich ist"); - } + if (b->small) { + strcat(smallbuf, ", die tödlich ist"); + } #endif /* Sieben Leben */ @@ -1850,9 +1855,6 @@ hits(troop at, troop dt, weapon * awp) strcat(smallbuf, " und trifft."); battlerecord(b,smallbuf); } -#endif -#ifdef SHOW_KILLS - ++at.fighter->hits; #endif return 1; } diff --git a/src/common/kernel/combatspells.c b/src/common/kernel/combatspells.c index b7006b6da..8af0903b6 100644 --- a/src/common/kernel/combatspells.c +++ b/src/common/kernel/combatspells.c @@ -716,9 +716,9 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp) assert(dt.fighter); if (hits(at, dt, NULL)) { drain_exp(dt.fighter->unit, 90); - drained++; + ++drained; + killed += terminate(dt, at, AT_COMBATSPELL, damage, false); } - killed += terminate(dt, at, AT_COMBATSPELL, damage, false); --force; } diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index e21b833be..8ba0a5457 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -840,7 +840,7 @@ enum { #define HELP_GUARD 16 /* Laesst Steuern eintreiben etc. */ #define HELP_FSTEALTH 32 /* Parteitarnung anzeigen. */ #define HELP_TRAVEL 64 /* Laesst Regionen betreten. */ -#define HELP_ALL (127-HELP_OBSERVE) /* Alle "positiven" HELPs zusammen */ +#define HELP_ALL (127-HELP_TRAVEL-HELP_OBSERVE) /* Alle "positiven" HELPs zusammen */ /* HELP_OBSERVE deaktiviert */ /* ------------------------------------------------------------- */ /* Prototypen */ diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index e42447d00..a081f97af 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -511,7 +511,7 @@ travel_route(const unit * u, region * r, region_list * route) /* kein travelthru in der letzten region! */ while (route) { travelthru(u, r); - r = route->data; + r = route->data; route = route->next; } }