This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in the attack/fire code?


>> if (reason && rslt == A_ANY_NO_AMMO)
>>   *reason = (HistEventType)rslt;
>> rslt = check_fire_at_action(unit, unit, other, -1);
>> if (valid(rslt)) {
>>     net_prep_fire_at_action(unit, unit, other, -1);
>>     return TRUE;
>> }
>
>Shouldn't there be some "else" statements in there to prevent more than
>one possible course of action being chosen?

No. Notice the "return" after each net_prep action. This ensures that only
one of them (the first to pass the check) is executed.

Hans

Hans Ronne

hronne@pp.sbbs.se



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]