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;
|
const char *name;
|
||||||
|
|
||||||
if (u && *i_find(&u->items, itype) == NULL) return false;
|
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);
|
name = resourcename(itype->rtype, 0);
|
||||||
sprintf(filename, "%s/%s/items/%s", resourcepath(), locale_name(f->locale), name);
|
sprintf(filename, "%s/%s/items/%s", resourcepath(), locale_name(f->locale), name);
|
||||||
fp = fopen(filename, "r");
|
fp = fopen(filename, "r");
|
||||||
|
@ -2333,8 +2329,8 @@ display_item(faction *f, unit *u, const item_type * itype)
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
name = buf;
|
name = buf;
|
||||||
/* } */
|
ADDMSG(&f->msgs, msg_message("displayitem", "weight item description",
|
||||||
ADDMSG(&f->msgs, msg_message("displayitem", "item description", itype->rtype, strdup(name)));
|
itype->weight/1000, itype->rtype, strdup(name)));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1987,7 +1987,7 @@ attack(battle *b, troop ta, const att *a, int numattack)
|
||||||
switch(a->type) {
|
switch(a->type) {
|
||||||
case AT_STANDARD: /* Waffen, mag. Gegenstände, Kampfzauber */
|
case AT_STANDARD: /* Waffen, mag. Gegenstände, Kampfzauber */
|
||||||
case AT_COMBATSPELL:
|
case AT_COMBATSPELL:
|
||||||
if (af->magic > 0) {
|
if (numattack==0 && af->magic > 0) {
|
||||||
/* Magier versuchen immer erstmal zu zaubern, erst wenn das
|
/* Magier versuchen immer erstmal zu zaubern, erst wenn das
|
||||||
* fehlschlägt, wird af->magic == 0 und der Magier kämpft
|
* fehlschlägt, wird af->magic == 0 und der Magier kämpft
|
||||||
* konventionell weiter */
|
* konventionell weiter */
|
||||||
|
@ -2027,11 +2027,11 @@ attack(battle *b, troop ta, const att *a, int numattack)
|
||||||
}
|
}
|
||||||
if (!td.fighter) return;
|
if (!td.fighter) return;
|
||||||
|
|
||||||
if(td.fighter->person[td.index].last_action < b->turn) {
|
if (td.fighter->person[td.index].last_action < b->turn) {
|
||||||
td.fighter->person[td.index].last_action = b->turn;
|
td.fighter->person[td.index].last_action = b->turn;
|
||||||
td.fighter->action_counter++;
|
td.fighter->action_counter++;
|
||||||
}
|
}
|
||||||
if(ta.fighter->person[ta.index].last_action < b->turn) {
|
if (ta.fighter->person[ta.index].last_action < b->turn) {
|
||||||
ta.fighter->person[ta.index].last_action = b->turn;
|
ta.fighter->person[ta.index].last_action = b->turn;
|
||||||
ta.fighter->action_counter++;
|
ta.fighter->action_counter++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4050,7 +4050,7 @@ sp_charmingsong(castorder *co)
|
||||||
int tb = 0;
|
int tb = 0;
|
||||||
|
|
||||||
/* wenn kein Ziel gefunden, Zauber abbrechen */
|
/* wenn kein Ziel gefunden, Zauber abbrechen */
|
||||||
if(pa->param[0]->flag == TARGET_NOTFOUND) return 0;
|
if (pa->param[0]->flag == TARGET_NOTFOUND) return 0;
|
||||||
|
|
||||||
target = pa->param[0]->data.u;
|
target = pa->param[0]->data.u;
|
||||||
|
|
||||||
|
|
|
@ -272,8 +272,10 @@
|
||||||
<type>
|
<type>
|
||||||
<arg name="item" type="resource"/>
|
<arg name="item" type="resource"/>
|
||||||
<arg name="description" type="string"/>
|
<arg name="description" type="string"/>
|
||||||
|
<arg name="weight" type="int"/>
|
||||||
</type>
|
</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>
|
||||||
<message name="healall" section="events">
|
<message name="healall" section="events">
|
||||||
<type>
|
<type>
|
||||||
|
|
|
@ -213,6 +213,14 @@ function test_parser()
|
||||||
write_game("parser")
|
write_game("parser")
|
||||||
end
|
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_fail()
|
||||||
-- test_handler()
|
-- test_handler()
|
||||||
-- test_parser()
|
-- test_parser()
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
The crash of the day:
|
weights in item descriptions
|
||||||
giving units names or descriptions that exceed NAMESIZE/DISPLAYSIZE can be a bad thing.
|
|
||||||
|
|
||||||
[11:01] <Enno`> am besten wäre, wenn mailit nur die optionen, nicht das ganze script enthielte
|
[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
|
[11:01] <Enno`> und ein skript dann mailit als input nähme
|
||||||
|
|
Loading…
Reference in New Issue