forked from github/server
remove a TODO that was ill-advised. The reason that "resources" is a list is that it's built incrementally.
This commit is contained in:
parent
ef44a4534e
commit
4bc8817056
|
@ -776,7 +776,7 @@
|
|||
<arg name="unit" type="unit"/>
|
||||
<arg name="region" type="region"/>
|
||||
<arg name="command" type="order"/>
|
||||
<arg name="required" type="resource_list"/>
|
||||
<arg name="required" type="resources"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Dafür braucht die Einheit $resources($required)."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - For this, the unit needs $resources($required)."</text>
|
||||
|
@ -2374,7 +2374,7 @@
|
|||
<arg name="unit" type="unit"/>
|
||||
<arg name="region" type="region"/>
|
||||
<arg name="command" type="order"/>
|
||||
<arg name="list" type="resource_list"/>
|
||||
<arg name="list" type="resources"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Für diesen Zauber fehlen noch $resources($list)."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Casting this spell requires an additional $resources($list)."</text>
|
||||
|
|
|
@ -640,7 +640,6 @@ message *msg_materials_required(unit * u, order * ord,
|
|||
if (multi <= 0 || multi == INT_MAX)
|
||||
multi = 1;
|
||||
for (c = 0; ctype && ctype->materials[c].number; ++c) {
|
||||
// TODO: lots of alloc/dealloc calls here (make var_copy_resources take an array)
|
||||
resource *res = malloc(sizeof(resource));
|
||||
res->number = multi * ctype->materials[c].number / ctype->reqsize;
|
||||
res->type = ctype->materials[c].rtype;
|
||||
|
|
|
@ -993,7 +993,6 @@ cancast(unit * u, const spell * sp, int level, int range, struct order * ord)
|
|||
|
||||
itemhave = get_pooled(u, rtype, GET_DEFAULT, itemanz);
|
||||
if (itemhave < itemanz) {
|
||||
// TODO: lots of alloc/dealloc calls here (make var_copy_resources take an array)
|
||||
resource *res = malloc(sizeof(resource));
|
||||
res->number = itemanz - itemhave;
|
||||
res->type = rtype;
|
||||
|
|
|
@ -1688,7 +1688,7 @@ static variant var_copy_items(variant x)
|
|||
return x;
|
||||
}
|
||||
|
||||
static variant var_copy_resource_list(variant x)
|
||||
static variant var_copy_resources(variant x)
|
||||
{
|
||||
resource *rsrc;
|
||||
resource *rdst = NULL, **rptr = &rdst;
|
||||
|
@ -1705,7 +1705,7 @@ static variant var_copy_resource_list(variant x)
|
|||
return x;
|
||||
}
|
||||
|
||||
static void var_free_resource_list(variant x)
|
||||
static void var_free_resources(variant x)
|
||||
{
|
||||
resource *rsrc = (resource *)x.v;
|
||||
while (rsrc) {
|
||||
|
@ -2250,9 +2250,8 @@ void register_reports(void)
|
|||
register_argtype("int", NULL, NULL, VAR_INT);
|
||||
register_argtype("string", var_free_string, var_copy_string, VAR_VOIDPTR);
|
||||
register_argtype("order", var_free_order, var_copy_order, VAR_VOIDPTR);
|
||||
register_argtype("resource_list", var_free_resource_list, var_copy_resource_list, VAR_VOIDPTR);
|
||||
//register_argtype("resources", var_free_resources, var_copy_resources, VAR_VOIDPTR);
|
||||
register_argtype("items", var_free_resource_list, var_copy_items, VAR_VOIDPTR);
|
||||
register_argtype("resources", var_free_resources, var_copy_resources, VAR_VOIDPTR);
|
||||
register_argtype("items", var_free_resources, var_copy_items, VAR_VOIDPTR);
|
||||
register_argtype("regions", var_free_regions, NULL, VAR_VOIDPTR);
|
||||
|
||||
msg_log_create = &log_orders;
|
||||
|
|
|
@ -434,7 +434,7 @@ static void test_arg_resources(CuTest *tc) {
|
|||
res[1].next = NULL;
|
||||
|
||||
register_reports();
|
||||
atype = find_argtype("resource_list");
|
||||
atype = find_argtype("resources");
|
||||
CuAssertPtrNotNull(tc, atype);
|
||||
v2 = atype->copy(v1);
|
||||
free(v1.v);
|
||||
|
|
Loading…
Reference in New Issue