forked from github/server
test: lighhouse size reduction reduces effectiveness
This commit is contained in:
parent
fc80e4b83e
commit
7b7d3cb759
2 changed files with 7 additions and 4 deletions
|
@ -25,10 +25,10 @@ bool is_lighthouse(const building_type *btype)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update_lighthouse: call this function whenever the size of a lighthouse changes
|
/* update_lighthouse: call this function whenever the size of a lighthouse changes
|
||||||
* it adds temporary markers to the surrounding regions.
|
* it adds temporary markers to the surrounding regions.
|
||||||
* The existence of markers says nothing about the quality of the observer in
|
* The existence of markers says nothing about the quality of the observer in
|
||||||
* the lighthouse, for this may change more frequently.
|
* the lighthouse, since this may change more frequently.
|
||||||
*/
|
*/
|
||||||
void update_lighthouse(building * lh)
|
void update_lighthouse(building * lh)
|
||||||
{
|
{
|
||||||
region *r = lh->region;
|
region *r = lh->region;
|
||||||
|
|
|
@ -122,6 +122,9 @@ static void test_lighthouse_guard(CuTest * tc) {
|
||||||
CuAssertIntEquals(tc, true, lighthouse_guarded(r2));
|
CuAssertIntEquals(tc, true, lighthouse_guarded(r2));
|
||||||
CuAssertIntEquals(tc, true, lighthouse_guarded(r3));
|
CuAssertIntEquals(tc, true, lighthouse_guarded(r3));
|
||||||
CuAssertIntEquals(tc, false, lighthouse_guarded(r4));
|
CuAssertIntEquals(tc, false, lighthouse_guarded(r4));
|
||||||
|
b->size = 1; /* size can go down in destroy_cmd */
|
||||||
|
CuAssertIntEquals(tc, false, lighthouse_guarded(r2));
|
||||||
|
CuAssertIntEquals(tc, false, lighthouse_guarded(r3));
|
||||||
test_teardown();
|
test_teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue