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)
|
nreport(natid actor, int event, natid victim, int times)
|
||||||
{
|
{
|
||||||
int nice;
|
int nice;
|
||||||
struct natstr *natp;
|
|
||||||
struct newscache *ncp;
|
struct newscache *ncp;
|
||||||
|
|
||||||
if (CANT_HAPPEN((unsigned)event > N_MAX_VERB
|
if (CANT_HAPPEN((unsigned)event > N_MAX_VERB
|
||||||
|| rpt[event].r_newstory[0] == rpt[0].r_newstory[0]))
|
|| rpt[event].r_newstory[0] == rpt[0].r_newstory[0]))
|
||||||
return;
|
return;
|
||||||
|
if (CANT_HAPPEN(actor >= MAXNOC || victim >= MAXNOC))
|
||||||
|
return;
|
||||||
|
|
||||||
ncp = ncache(actor, event, victim, times);
|
ncp = ncache(actor, event, victim, times);
|
||||||
putnews(ncp->id, &ncp->news);
|
putnews(ncp->id, &ncp->news);
|
||||||
|
@ -83,9 +84,7 @@ nreport(natid actor, int event, natid victim, int times)
|
||||||
return;
|
return;
|
||||||
if (!chance((double)-nice * times / 20.0))
|
if (!chance((double)-nice * times / 20.0))
|
||||||
return;
|
return;
|
||||||
if (!(natp = getnatp(victim)))
|
if (getrel(getnatp(victim), actor) < HOSTILE)
|
||||||
return;
|
|
||||||
if (getrel(natp, actor) < HOSTILE)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setrel(victim, actor, HOSTILE);
|
setrel(victim, actor, HOSTILE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue