forked from github/server
issue #428, fix writing spell description for break_curse
This commit is contained in:
parent
65902ca97f
commit
6a20345b53
|
@ -594,7 +594,7 @@
|
|||
<spell name="destroy_magic" rank="2" index="106" parameters="kc+" los="true" ship="true" far="true" variable="true">
|
||||
<resource name="aura" amount="4" cost="level"/>
|
||||
</spell>
|
||||
<spell name="break_curse" rank="3" index="107" syntax="spellid" parameters="kcc?" los="true" ship="true" far="true" variable="true">
|
||||
<spell name="break_curse" rank="3" index="107" syntax="spellid" parameters="kcc" los="true" ship="true" far="true" variable="true">
|
||||
<resource name="aura" amount="3" cost="level"/>
|
||||
</spell>
|
||||
<spell name="fish_shield" rank="2" index="109" variable="true" combat="1">
|
||||
|
|
|
@ -337,7 +337,7 @@
|
|||
<spell name="destroy_magic" rank="2" index="106" parameters="kc+" los="true" ship="true" far="true" variable="true">
|
||||
<resource name="aura" amount="4" cost="level"/>
|
||||
</spell>
|
||||
<spell name="break_curse" rank="3" index="107" syntax="spellid" parameters="kcc?" los="true" ship="true" far="true" variable="true">
|
||||
<spell name="break_curse" rank="3" index="107" syntax="spellid" parameters="kcc" los="true" ship="true" far="true" variable="true">
|
||||
<resource name="aura" amount="3" cost="level"/>
|
||||
</spell>
|
||||
<spell name="meteor_rain" rank="5" index="108" variable="true" combat="2">
|
||||
|
|
|
@ -536,11 +536,17 @@ void nr_spell_syntax(stream *out, spellbook_entry * sbe, const struct locale *la
|
|||
locp = LOC(lang, mkname("spellpar", substr));
|
||||
syntaxp = substr + 1;
|
||||
}
|
||||
if (*params == '?') {
|
||||
++params;
|
||||
bytes = (int)_snprintf(bufp, size, " [<%s>]", locp);
|
||||
}
|
||||
else {
|
||||
bytes = (int)_snprintf(bufp, size, " <%s>", locp);
|
||||
}
|
||||
if (wrptr(&bufp, &size, bytes) != 0)
|
||||
WARN_STATIC_BUFFER();
|
||||
} else {
|
||||
log_error("unknown spell parameter %c for spell", cp, sp->sname);
|
||||
log_error("unknown spell parameter %c for spell %s", cp, sp->sname);
|
||||
}
|
||||
}
|
||||
*bufp = 0;
|
||||
|
|
|
@ -393,14 +393,12 @@ static void test_write_spell_syntax(CuTest *tc) {
|
|||
free(spell.sp->syntax);
|
||||
spell.sp->syntax = 0;
|
||||
|
||||
/* There are no spells with optional parameters, so we don't force this, for now
|
||||
set_parameter(spell, "c?");
|
||||
free(spell.sp->syntax);
|
||||
spell.sp->syntax = _strdup("hodor");
|
||||
check_spell_syntax(tc, "c?", &spell, " ZAUBERE \"Testzauber\" [<Hodor>]");
|
||||
free(spell.sp->syntax);
|
||||
spell.sp->syntax = 0;
|
||||
*/
|
||||
|
||||
set_parameter(spell, "kc+");
|
||||
check_spell_syntax(tc, "kc+", &spell,
|
||||
|
|
Loading…
Reference in New Issue