Oops on invalid actor and victim arguments in nreport()
Replaces the existing, silent recovery from invalid victim argument.
This commit is contained in:
parent
38e59474b1
commit
05b3e1b8d8
1 changed files with 3 additions and 4 deletions
|
@ -59,12 +59,13 @@ void
|
|||
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);
|
||||
|
@ -83,9 +84,7 @@ nreport(natid actor, int event, natid victim, int times)
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue