[Freeciv-Dev] Re: (PR#1364) Assertion fails in get_role_unit()
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Nov 19, 2002 at 01:30:01AM -0800, Petr Baudis via RT wrote:
> Dear diary, on Mon, Nov 18, 2002 at 11:29:31AM CET, I got a letter,
> where Raimar Falke via RT <rt@xxxxxxxxxxxxxx> told me, that...
> > I audited all uses of get_role_unit. All user in the current CVS
> > version check before usage.
>
> Meep? Excuse me, I feel a bit lost now.. what's up? ;-)
Sorry. Should read "All users in the current CVS check if the roles
are available at all before usage." This means that:
get_role_unit(role, x)
is bad if you don't guard it with a
if(num_role_units(role) > 0)
or it is a role which is guaranteed to exists (see the end of
server/ruleset.c:load_ruleset_units).
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
Q: Do you know what the death rate around here is?
A: One per person.
|
|