Feature #1916 ยป 0061-AI-Add-war-countdown-sanity-check.patch
| ai/default/daiplayer.c | ||
|---|---|---|
|
/* server */
|
||
|
#include "citytools.h"
|
||
|
#include "sanitycheck.h"
|
||
|
/* ai/default */
|
||
|
#include "daidata.h"
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
void dai_sanity_check(struct ai_type *ait, struct player *pplayer)
|
||
|
{
|
||
|
#ifdef SANITY_CHECKING
|
||
|
#define SANITY_CHECK(check) \
|
||
|
fc_assert_full(__FILE__, __FUNCTION__, __FC_LINE__, check, , NOLOGMSG, NOLOGMSG)
|
||
|
players_iterate_alive(opponent) {
|
||
|
struct ai_dip_intel *adip = dai_diplomacy_get(ait, pplayer, opponent);
|
||
|
bool at_war = pplayers_at_war(pplayer, opponent);
|
||
|
/* SANITY_CHECK(adip->countdown < 0 || !at_war); */
|
||
|
SANITY_CHECK(adip->countdown >= -1 || at_war);
|
||
|
} players_iterate_alive_end;
|
||
|
#endif /* SANITY_CHECKING */
|
||
|
}
|
||