Removed some warnings about type conversion.

This commit is contained in:
Enno Rehling 2002-11-25 16:53:10 +00:00
parent 76b0371100
commit ec761909a9
4 changed files with 25 additions and 8 deletions

View File

@ -485,11 +485,11 @@ add_give(unit * u, unit * u2, int n, const resource_type * rtype, const char * c
assert(rtype); assert(rtype);
add_message(&u->faction->msgs, add_message(&u->faction->msgs,
msg_message("give", "unit target resource amount", msg_message("give", "unit target resource amount",
u, u2?ucansee(u->faction, u2, &u_unknown):&u_peasants, rtype, n)); u, u2?ucansee(u->faction, u2, u_unknown()):u_peasants(), rtype, n));
if (u2) { if (u2) {
add_message(&u2->faction->msgs, add_message(&u2->faction->msgs,
msg_message("give", "unit target resource amount", msg_message("give", "unit target resource amount",
ucansee(u2->faction, u, &u_unknown), u2, rtype, n)); ucansee(u2->faction, u, u_unknown()), u2, rtype, n));
} }
} }
} }
@ -884,7 +884,7 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
if (u->faction != u2->faction) { if (u->faction != u2->faction) {
add_message(&u2->faction->msgs, add_message(&u2->faction->msgs,
msg_message("givecommand", "unit receipient", msg_message("givecommand", "unit receipient",
ucansee(u2->faction, u, &u_unknown), u2)); ucansee(u2->faction, u, u_unknown()), u2));
} }
return; return;
} }

View File

@ -55,8 +55,25 @@
int demonfix = 0; int demonfix = 0;
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
const unit u_peasants = { NULL, NULL, NULL, NULL, NULL, 2, "die Bauern" }; const unit *
const unit u_unknown = { NULL, NULL, NULL, NULL, NULL, 1, "eine unbekannte Einheit" }; u_peasants(void)
{
static unit peasants = { NULL, NULL, NULL, NULL, NULL, 2, NULL };
if (peasants.name==NULL) {
peasants.name = strdup("die Bauern");
}
return &peasants;
}
const unit *
u_unknown(void)
{
static unit unknown = { NULL, NULL, NULL, NULL, NULL, 1, NULL };
if (unknown.name==NULL) {
unknown.name =strdup("eine unbekannte Einheit");
}
return &unknown;
}
#define DMAXHASH 8191 #define DMAXHASH 8191
typedef struct dead { typedef struct dead {

View File

@ -105,8 +105,8 @@ void usetcontact(struct unit * u, const struct unit * c);
struct unit * findnewunit (const struct region * r, const struct faction *f, int alias); struct unit * findnewunit (const struct region * r, const struct faction *f, int alias);
#define upotions(u) fval(u, FL_POTIONS) #define upotions(u) fval(u, FL_POTIONS)
extern const struct unit u_peasants; extern const struct unit * u_peasants(void);
extern const struct unit u_unknown; extern const struct unit * u_unknown(void);
extern struct unit * udestroy; extern struct unit * udestroy;

View File

@ -183,7 +183,7 @@
<familiar race="nymph"></familiar> <familiar race="nymph"></familiar>
<familiar race="imp"></familiar> <familiar race="imp"></familiar>
</race> </race>
<race name="shadow knight" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="5" maintenance="0" weight="1000" capacity="540" speed="1.000000" hp="1" ac="0" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants walk nolearn noteach noblock> <race name="shadow knight" magres="0.000000" maxaura="0.000000" regaura="0.000000" recruitcost="5" maintenance="0" weight="1000" capacity="540" speed="1.000000" hp="1" ac="0" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants nogive walk nolearn noteach noblock>
<ai splitsize="20000" moverandom></ai> <ai splitsize="20000" moverandom></ai>
<attack type="1" damage="1d1"></attack> <attack type="1" damage="1d1"></attack>
</race> </race>