forked from github/server
CID 22452 'Constant' variable guards dead code
github issue #353 there is no a_fshidden attribute.
This commit is contained in:
parent
a6039c7611
commit
c9f886078b
|
@ -335,3 +335,14 @@ function test_stonegolems()
|
|||
assert_equal(1 ,u2.number, "There shoud be one Stone Golems")
|
||||
-- end test Stone Golems four stones
|
||||
end
|
||||
|
||||
|
||||
function test_birthdaycake()
|
||||
r = region.create(0,0, "plain")
|
||||
f = faction.create("cake@eressea.de", "human", "de")
|
||||
u = unit.create(f, r, 1)
|
||||
u:add_item("birthdaycake", 1)
|
||||
u:clear_orders()
|
||||
u:add_order("ZEIGE Geburtstagstorte")
|
||||
process_orders()
|
||||
end
|
||||
|
|
|
@ -746,7 +746,6 @@ void cr_output_unit(stream *out, const region * r, const faction * f,
|
|||
building *b;
|
||||
const char *pzTmp;
|
||||
skill *sv;
|
||||
const attrib *a_fshidden = NULL;
|
||||
bool itemcloak = false;
|
||||
static const curse_type *itemcloak_ct = 0;
|
||||
static bool init = false;
|
||||
|
@ -834,13 +833,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f,
|
|||
stream_printf(out, "\"%s\";typprefix\n", translate(prefix, LOC(f->locale,
|
||||
prefix)));
|
||||
}
|
||||
if (u->faction != f && a_fshidden
|
||||
&& a_fshidden->data.ca[0] == 1 && effskill(u, SK_STEALTH, 0) >= 6) {
|
||||
stream_printf(out, "-1;Anzahl\n");
|
||||
}
|
||||
else {
|
||||
stream_printf(out, "%d;Anzahl\n", u->number);
|
||||
}
|
||||
|
||||
pzTmp = get_racename(u->attribs);
|
||||
if (pzTmp) {
|
||||
|
@ -981,8 +974,7 @@ void cr_output_unit(stream *out, const region * r, const faction * f,
|
|||
if (f == u->faction || omniscient(f)) {
|
||||
show = u->items;
|
||||
}
|
||||
else if (!itemcloak && mode >= see_unit && !(a_fshidden
|
||||
&& a_fshidden->data.ca[1] == 1 && effskill(u, SK_STEALTH, 0) >= 3)) {
|
||||
else if (!itemcloak && mode >= see_unit) {
|
||||
int n = report_items(u->items, result, MAX_INVENTORY, u, f);
|
||||
assert(n >= 0);
|
||||
if (n > 0)
|
||||
|
|
|
@ -456,7 +456,6 @@ size_t size)
|
|||
building *b;
|
||||
bool isbattle = (bool)(mode == see_battle);
|
||||
int telepath_see = 0;
|
||||
attrib *a_fshidden = NULL;
|
||||
item *itm;
|
||||
item *show;
|
||||
faction *fv = visible_faction(f, u);
|
||||
|
@ -520,14 +519,8 @@ size_t size)
|
|||
|
||||
bufp = STRLCPY(bufp, ", ", size);
|
||||
|
||||
if (u->faction != f && a_fshidden && a_fshidden->data.ca[0] == 1
|
||||
&& effskill(u, SK_STEALTH, 0) >= 6) {
|
||||
bufp = STRLCPY(bufp, "? ", size);
|
||||
}
|
||||
else {
|
||||
if (wrptr(&bufp, &size, _snprintf(bufp, size, "%d ", u->number)))
|
||||
WARN_STATIC_BUFFER();
|
||||
}
|
||||
|
||||
pzTmp = get_racename(u->attribs);
|
||||
if (pzTmp) {
|
||||
|
@ -607,8 +600,7 @@ size_t size)
|
|||
if (f == u->faction || telepath_see || omniscient(f)) {
|
||||
show = u->items;
|
||||
}
|
||||
else if (!itemcloak && mode >= see_unit && !(a_fshidden
|
||||
&& a_fshidden->data.ca[1] == 1 && effskill(u, SK_STEALTH, 0) >= 3)) {
|
||||
else if (!itemcloak && mode >= see_unit) {
|
||||
int n = report_items(u->items, results, MAX_INVENTORY, u, f);
|
||||
assert(n >= 0);
|
||||
if (n > 0)
|
||||
|
|
Loading…
Reference in New Issue