forked from github/server
Gewichtsangaben bei der Anzeige von items
This commit is contained in:
parent
d6cd1c0efe
commit
a653ea0824
|
@ -2304,11 +2304,7 @@ display_item(faction *f, unit *u, const item_type * itype)
|
|||
const char *name;
|
||||
|
||||
if (u && *i_find(&u->items, itype) == NULL) return false;
|
||||
/*
|
||||
info = mkname("info", itype->rtype->_name[0]);
|
||||
name = LOC(u->faction->locale, info);
|
||||
if (strcmp(name, info)==0) {
|
||||
*/
|
||||
|
||||
name = resourcename(itype->rtype, 0);
|
||||
sprintf(filename, "%s/%s/items/%s", resourcepath(), locale_name(f->locale), name);
|
||||
fp = fopen(filename, "r");
|
||||
|
@ -2333,8 +2329,8 @@ display_item(faction *f, unit *u, const item_type * itype)
|
|||
}
|
||||
fclose(fp);
|
||||
name = buf;
|
||||
/* } */
|
||||
ADDMSG(&f->msgs, msg_message("displayitem", "item description", itype->rtype, strdup(name)));
|
||||
ADDMSG(&f->msgs, msg_message("displayitem", "weight item description",
|
||||
itype->weight/1000, itype->rtype, strdup(name)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1987,7 +1987,7 @@ attack(battle *b, troop ta, const att *a, int numattack)
|
|||
switch(a->type) {
|
||||
case AT_STANDARD: /* Waffen, mag. Gegenstände, Kampfzauber */
|
||||
case AT_COMBATSPELL:
|
||||
if (af->magic > 0) {
|
||||
if (numattack==0 && af->magic > 0) {
|
||||
/* Magier versuchen immer erstmal zu zaubern, erst wenn das
|
||||
* fehlschlägt, wird af->magic == 0 und der Magier kämpft
|
||||
* konventionell weiter */
|
||||
|
|
|
@ -272,8 +272,10 @@
|
|||
<type>
|
||||
<arg name="item" type="resource"/>
|
||||
<arg name="description" type="string"/>
|
||||
<arg name="weight" type="int"/>
|
||||
</type>
|
||||
<text locale="de">"$resource($item,1): $description"</text>
|
||||
<text locale="de">"$resource($item,1) ($int($weight) GE): $description"</text>
|
||||
<text locale="en">"$resource($item,1) ($int($weight) st): $description"</text>
|
||||
</message>
|
||||
<message name="healall" section="events">
|
||||
<type>
|
||||
|
|
|
@ -213,6 +213,14 @@ function test_parser()
|
|||
write_game("parser")
|
||||
end
|
||||
|
||||
function test_fail()
|
||||
plain = terraform(0, 0, "plain")
|
||||
skill = 5
|
||||
|
||||
f = add_faction("enno@eressea.de", "human", "de")
|
||||
print(f)
|
||||
end
|
||||
|
||||
test_fail()
|
||||
-- test_handler()
|
||||
-- test_parser()
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
The crash of the day:
|
||||
giving units names or descriptions that exceed NAMESIZE/DISPLAYSIZE can be a bad thing.
|
||||
weights in item descriptions
|
||||
|
||||
[11:01] <Enno`> am besten wäre, wenn mailit nur die optionen, nicht das ganze script enthielte
|
||||
[11:01] <Enno`> und ein skript dann mailit als input nähme
|
||||
|
|
Loading…
Reference in New Issue