CATAPULT_STRUCTURAL_DAMAGE was broken.

check for PDCURSES, not WIN32
This commit is contained in:
Enno Rehling 2018-02-25 14:29:25 +01:00
parent e4aa8f505e
commit 7b01581302
5 changed files with 12 additions and 10 deletions

View File

@ -86,7 +86,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define TACTICS_MODIFIER 1 /* modifier for generals in the front/rear */
#define CATAPULT_INITIAL_RELOAD 4 /* erster schuss in runde 1 + rng_int() % INITIAL */
#define CATAPULT_STRUCTURAL_DAMAGE
#define BASE_CHANCE 70 /* 70% Basis-<2D>berlebenschance */
#define TDIFF_CHANGE 5 /* 5% h<>her pro Stufe */

View File

@ -144,7 +144,7 @@ static void init_curses(void)
short bcol = COLOR_BLACK;
short hcol = COLOR_MAGENTA;
start_color();
#ifdef WIN32
#ifdef __PDCURSES__
/* looks crap on putty with TERM=linux */
if (can_change_color()) {
init_color(COLOR_YELLOW, 1000, 1000, 0);
@ -422,6 +422,15 @@ static bool handle_info_region(window * wnd, state * st, int c)
return false;
}
int wxborder(WINDOW *win)
{
#ifdef __PDCURSES__
return wborder(win, 0, 0, 0, 0, 0, 0, 0, 0);
#else
return wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
#endif
}
static void paint_info_region(window * wnd, const state * st)
{
WINDOW *win = wnd->handle;

View File

@ -41,6 +41,8 @@ extern "C" {
void make_block(int x, int y, int radius, const struct terrain_type *terrain);
void seed_players(struct newfaction **players, bool new_island);
int wxborder(WINDOW *win);
#ifdef __cplusplus
}
#endif

View File

@ -90,12 +90,6 @@ extern "C" {
#define TWIDTH 2 /* width of tile */
#define THEIGHT 1 /* height of tile */
#ifdef WIN32
#define wxborder(win) wborder(win, 0, 0, 0, 0, 0, 0, 0, 0)
#else
#define wxborder(win) wborder(win, '|', '|', '-', '-', '+', '+', '+', '+')
#endif
#ifdef __cplusplus
}
#endif

View File

@ -138,7 +138,6 @@ int *casualties)
/* If battle succeeds */
if (hits(*at, dt, wp)) {
d += terminate(dt, *at, AT_STANDARD, wp->type->damage[0], true);
#ifdef CATAPULT_STRUCTURAL_DAMAGE
if (dt.fighter->unit->building && rng_int() % 100 < 5) {
double dmg = config_get_flt("rules.building.damage.catapult", 1);
damage_building(b, dt.fighter->unit->building, dmg);
@ -147,7 +146,6 @@ int *casualties)
double dmg = config_get_flt("rules.ship.damage.catapult", 0.01);
damage_ship(dt.fighter->unit->ship, dmg)
}
#endif
}
}