(guerrilla): Oops on it.
(doland, takeover): Clear them when che_target becomes 0.
(doland): Fix bogus message.
(guerrilla): Remove silly sanity check.
case 'X':
old = sect->sct_che_target;
new = errcheck(arg, 0, MAXNOC - 1);
- pr("Old owner of %s changed from %s (#%d) to %s (#%d).\n",
+ pr("Che target of %s changed from %s (#%d) to %s (#%d).\n",
xyas(sect->sct_x, sect->sct_y, player->cnum),
cname(old), old, cname(new), new);
sect->sct_che_target = new;
+ if (new == 0)
+ sect->sct_che = 0;
break;
case 'p':
old = sect->sct_pstage;
sp->sct_che = che_count;
if (newown != sp->sct_oldown)
sp->sct_che_target = newown;
+ if (sp->sct_che_target == 0)
+ sp->sct_che = 0;
sp->sct_item[I_CIVIL] = civ;
if (sp->sct_oldown == newown || civ == 0) {
/*
}
target = sp->sct_che_target;
- if (target == 0) {
- /* the deity can't be a target! */
+ if (CANT_HAPPEN(target == 0))
return;
- }
tnat = getnatp(target);
if (tnat->nat_stat == STAT_UNUSED) {
/* target nation has dissolved: che's retire. */
*/
if (chance(ratio * 0.10)) {
n = (mil / 5) + 1;
- if ((n + che) == 0) {
- logerror("n=%d che=%d\n", n, che);
- if (che == 0)
- return;
- }
odds = (double)che / (n + che);
odds /= hap_fact(tnat, getnatp(sp->sct_oldown));
while (che > 0 && n > 0) {