Welcome to the Builder Academy

Question simple_list resets itself

More
28 Dec 2016 02:49 #6473 by Liko
Replied by Liko on topic AFF FLYING

JTP wrote: Just tested it, max character ended up with ac 55 and hitroll 4 and damroll 5

Should have been 50 +5 +5...ponder ponder, just double checked over the levels it adds +1 hitroll 5 times, and +1 damroll 5 times...for ac -5 10 times.


Though the good news is that it Works with gear on when advancing, then removed gear and it was still ac 55 +4 +5

Just dunno why its not 50 +5 +5



// HR, DR, AC
{1, 0, -5}, <<<---maybe first line is regarded as lvl 0 ? and is not added ? It would explain the missing +1 hitroll and -5 ac. Or any other idea ?


I've been sitting thinking about your solution, wouldn't it be easier to use a for loop?
Code:
for(int i = 0; i < MAX_LEVEL; i++) { if(i % 5) { //do stuff here } }

Above code should work, may need some tweaking. I would define a MAX_LEVEL for mortals.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
28 Dec 2016 11:16 #6475 by thomas
Replied by thomas on topic AFF FLYING
Yes, first line is level 0. You could just add a "no-op" line like {0, 0, 0} there.

Please Log in or Create an account to join the conversation.

More
28 Dec 2016 12:11 - 28 Dec 2016 12:12 #6476 by JTP
Replied by JTP on topic AFF FLYING
Thanks that made it work.



On a side note: syserr simple_list() forced to reset itself

Whats the deal with that ? Picture is from file error.
Attachments:
Last edit: 28 Dec 2016 12:12 by JTP.

Please Log in or Create an account to join the conversation.

More
28 Dec 2016 12:42 #6477 by thomas
Replied by thomas on topic AFF FLYING
Good question. Somewhere, one of the lists assigned with simple_list() attempts to loop too far.

Please Log in or Create an account to join the conversation.

More
28 Dec 2016 12:55 #6478 by JTP
Replied by JTP on topic AFF FLYING
Code:
grep of simple_list act.other.c: while ((k = (struct char_data *) simple_list(ch->group->members)) != NULL) act.other.c: while ((group = (struct group_data *) simple_list(group_list)) != NULL) { act.other.c: while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) act.other.c: while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) Binary file act.other.o matches comm.c: while ((pEvent = simple_list(d->events)) != NULL) comm.c: while ((tch = simple_list(group->members)) != NULL) { Binary file comm.o matches db.c: while ((pEvent = simple_list(world[cnt].events)) != NULL) db.c: while ((pEvent = simple_list(ch->events)) != NULL) Binary file db.o matches fight.c: while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) fight.c: while ((k = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) fight.c: while ((tch = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) { Binary file fight.o matches genwld.c: while ((pEvent = simple_list(room->events)) != NULL) Binary file genwld.o matches handler.c: while ((pEvent = simple_list(obj->events)) != NULL) Binary file handler.o matches lists.c: clear_simple_list(); lists.c: while ((pContent = simple_list(pList))) lists.c:void clear_simple_list(void) lists.c: * while ((var = (struct XXX_data *) simple_list(XXX_list))) { lists.c:void * simple_list(struct list_data * pList) lists.c: clear_simple_list(); lists.c: mudlog(CMP, LVL_GRGOD, TRUE, "SYSERR: simple_list() forced to reset itself."); lists.h:void * simple_list(struct list_data * pList); lists.h:void clear_simple_list(void); Binary file lists.o matches magic.c: while ((tch = (struct char_data *) simple_list(GROUP(ch)->members)) != NULL) { Binary file magic.o matches mud_event.c: clear_simple_list(); mud_event.c: while ((pEvent = (struct event *) simple_list(ch->events)) != NULL) { mud_event.c: clear_simple_list(); mud_event.c: while ((pEvent = (struct event *) simple_list(ch->events)) != NULL) { mud_event.c: clear_simple_list(); mud_event.c: while ((pEvent = (struct event *) simple_list(ch->events)) != NULL) { Binary file mud_event.o matches

Please Log in or Create an account to join the conversation.

More
28 Dec 2016 22:17 #6479 by WhiskyTest
Replied by WhiskyTest on topic AFF FLYING
I've had the simple_list reset itself when using lists inside lists, an example of what that might be:

list all players, for each player list their equipment
so it makes a list of the players equipment while already listing all players.. something like that?

Please Log in or Create an account to join the conversation.

Time to create page: 0.255 seconds