Take a look at the SET_SKILL macro in pl12
#define SET_SKILL(ch, i, pct) { (ch)->player_specials->
saved.skills[i] = pct; } (on two lines)
There's already a semi-colon at the end of it which is
why you don't need to add a semicolon there.
If you do place a semi-colon there, then it looks like you'd
be trying to execute two statements after an if and before
the else which is probably causing the errors.
Whereas the ; after the else isn't going to cause a problem
because it doesn't have a corresponding conditional statement
to mess it up.
for example
the macro gets substituted in like ...
if (GET_LEVEL(ch) < LVL_IMPL)
{ (ch)->player_specials->saved.skills[i] = 0; }
;
else
{ (ch)->player_specials->saved.skills[i] = 100; }
If you want to check, you can try this out ...
if (GET_LEVEL(ch) < LVL_IMPL)
{
SET_SKILL(ch, i, 0);
} else
SET_SKILL(ch, i, 100);
Or, just switch over to pl14 which is a little bit different
as you noticed.
Sean
At 06:44 PM 09/24/1998 +0200, you wrote:
>Hiya,
>
>I'm using bpl12, and I noticed the following in db.c, in init_char:
>
> for (i = 1; i <= MAX_SKILLS; i++) {
> if (GET_LEVEL(ch) < LVL_IMPL)
> SET_SKILL(ch, i, 0) <---- No semi-colon!
> else
> SET_SKILL(ch, i, 100);
> }
>
>There's a semi-colon "missing". The code works fine however, and
>it won't even work when I -do- add the semi-colon. I'm working on
>something I want to base on the skill system, and I came across this...
>Anyone know why there shouldn't be a semi-colon there?
>(I figure it has something to do with the macro, bpl14 -does- have
> a semi-colon there, and a slightly different macro, with
> CHECK_PLAYER_SPECIALS)
>
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST