Re: [CODE] Arena affections crash

From: Del (caminturn@earthlink.net)
Date: 08/31/00


Melissa Jadwinski wrote:
>
> void arena_store_affects(struct char_data *ch, struct combatant_info_type
> *comb) {
>   struct affected_type *aff, *new_aff;
>
>   comb->affected = NULL;
>
>   for (aff = ch->affected; aff; aff = aff->next) {
>     CREATE(new_aff, struct affected_type, 1);
>     clear_affect(new_aff);
>
>     new_aff->type       = aff->type;  /* <-- Crashes here */
> #0  arena_store_affects (ch=0x874d478, comb=0x8750e70) at arena.c:207


Do you not want to move the CREATE and clear_affect out of the loop?
Each pass will create and clear new_aff.

Another question, how many players will be entering the arena and using
this struct?
If player two enters, will player one's info be gone? (I don't really
see
where it is copied to the player's struct for storage, or am I assuming
something
wrong?).


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT