/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
nreport(natid actor, int event, natid victim, int times)
{
int nice;
- struct natstr *natp;
struct newscache *ncp;
if (CANT_HAPPEN((unsigned)event > N_MAX_VERB
|| rpt[event].r_newstory[0] == rpt[0].r_newstory[0]))
return;
+ if (CANT_HAPPEN(actor >= MAXNOC || victim >= MAXNOC))
+ return;
ncp = ncache(actor, event, victim, times);
putnews(ncp->id, &ncp->news);
return;
if (!chance((double)-nice * times / 20.0))
return;
- if (!(natp = getnatp(victim)))
- return;
- if (getrel(natp, actor) < HOSTILE)
+ if (getrel(getnatp(victim), actor) < HOSTILE)
return;
setrel(victim, actor, HOSTILE);