From 1909d754b10cc26ac0ae7299a6cac1e3a721f60e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 20 Jan 2002 11:35:06 +0000 Subject: [PATCH] Memory-Overwrite --- src/common/gamecode/economy.c | 8 ++++---- src/common/gamecode/report.c | 2 +- src/common/kernel/message.h | 4 ++-- src/eressea/korrektur.c | 7 +++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index eb7c9e7e9..89d67b62e 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -1374,8 +1374,8 @@ manufacture(unit * u, const item_type * itype, int want) if (n>0) { i_change(&u->items, itype, n); if (want==INT_MAX) want = n; - add_message(&u->faction->msgs, - new_message(u->faction, "manufacture%u:unit%r:region%i:amount%i:wanted%X:resource", u, u->region, n, want, itype->rtype)); + ADDMSG(&u->faction->msgs, msg_message("manufacture", + "unit region amount wanted resource", u, u->region, n, want, itype->rtype)); } } @@ -1807,8 +1807,8 @@ create_potion(unit * u, const potion_type * ptype, int want) default: i_change(&u->items, ptype->itype, built); if (want==INT_MAX) want = built; - add_message(&u->faction->msgs, - new_message(u->faction, "manufacture%u:unit%r:region%i:amount%i:wanted%X:resource", u, u->region, built, want, ptype->itype->rtype)); + ADDMSG(&u->faction->msgs, msg_message(u->faction, "manufacture", + "unit region amount wanted resource", u, u->region, built, want, ptype->itype->rtype)); break; } } diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index b226284a0..47456d309 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -3004,7 +3004,7 @@ make_summary(boolean count_new) struct language * plang = s->languages; while (plang && plang->locale != lang) plang=plang->next; if (!plang) { - plang = calloc(sizeof(plang), 1); + plang = calloc(sizeof(struct language), 1); plang->next = s->languages; s->languages = plang; plang->locale = lang; diff --git a/src/common/kernel/message.h b/src/common/kernel/message.h index 26cc28ae1..ec93de071 100644 --- a/src/common/kernel/message.h +++ b/src/common/kernel/message.h @@ -15,11 +15,11 @@ #ifndef MESSAGE_H #define MESSAGE_H -struct faction; -struct warning; +#include struct message; struct messageclass; +struct faction; struct warning; struct msglevel; diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index fcb18f9e4..6b13f90c4 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -2751,6 +2751,7 @@ heal_all(void) region *r; unit *u; faction *f; + struct message * msg = msg_message("healall", ""); for(f=factions; f; f=f->next) { freset(f, FL_DH); @@ -2766,13 +2767,15 @@ heal_all(void) } } - for(f=factions; f; f=f->next) { + for (f=factions; f; f=f->next) { if(fval(f,FL_DH)) { - add_message(&f->msgs, new_message(f, "healall")); + add_message(&f->msgs, msg); freset(f, FL_DH); } } + msg_release(msg); + return 0; }