[CF-Devel] Re: [Crossfire-cvs] CVS commit: crossfire
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Mon Dec 27 15:29:33 CST 2004
crossfire-cvs-admin at lists.sourceforge.net
wrote:
> Module Name: crossfire
> Committed By: ryo_saeba
> Date: Sat Dec 25 18:09:29 UTC 2004
>
> Modified Files:
> crossfire: ChangeLog
> crossfire/common: map.c
> crossfire/server: c_chat.c c_party.c c_wiz.c main.c
>
> Log Message:
> Patches #1086095 and 1088385, party password length tweak
A few minor issues on this patch:
> Index: crossfire/common/map.c
> diff -c crossfire/common/map.c:1.68 crossfire/common/map.c:1.69
> *** crossfire/common/map.c:1.68 Sun Oct 17 23:54:35 2004
> --- crossfire/common/map.c Sat Dec 25 10:09:29 2004
> ***************
> *** 317,323 ****
> }
> } /* if check_inv */
> else if (QUERY_FLAG(tmp,FLAG_NO_PASS) || (QUERY_FLAG(tmp,FLAG_ALIVE) &&
> ! tmp->head != ob && tmp != ob && tmp->type != DOOR))
> return 1;
> }
> --- 317,324 ----
> }
> } /* if check_inv */
> else if (QUERY_FLAG(tmp,FLAG_NO_PASS) || (QUERY_FLAG(tmp,FLAG_ALIVE) &&
> ! tmp->head != ob && tmp != ob && tmp->type != DOOR) &&
> ! !(QUERY_FLAG(tmp,FLAG_WIZ) && tmp->contr->hidden))
>
> return 1;
> }
I'd like to see some more parens in that if statement there.
It may in fact be a reasonable idea to split that if into a few if statements
to make it clearer.
Stylisticly, I don't like ! complex expressions, eg, the !(a && b) - OTOH, I
guess the one thing by doing that is it is known the tmp->contr is a valid
structure.
But still, trying to read such statements and figure out what they are doing
starts to get pretty complicated at some point.
the forbid_play() function in main.c is similarly changed to have such a
construct, but isn't as bad as it is the only thing in the if statement, so is
easier to follow the logic in that one.
_______________________________________________
crossfire-devel mailing list
crossfire-devel at lists.real-time.com
https://mailman.real-time.com/mailman/listinfo/crossfire-devel
More information about the crossfire
mailing list