Welcome to the Builder Academy

Question Old patch from 1997

More
25 May 2016 23:06 #5940 by JTP
Replied by JTP on topic Old patch from 1997
i can fight a mob with and without trigger or just stand still doing nothing. It will crash at some point.

Sucks that it now saves all 3 and it crashes like hell. The mud has just run for 4 days with no problems, and now all this over this Little snippet :)

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

More
25 May 2016 23:07 #5941 by rudeboyrave
Replied by rudeboyrave on topic Old patch from 1997
post every line of code you edited, maybe we can find the problem. is it compiling error free?

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

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

More
25 May 2016 23:13 - 25 May 2016 23:17 #5942 by JTP
Replied by JTP on topic Old patch from 1997
Compiles just fine
Code:
structs.h after: int spells_to_learn; int rip_cnt; int kill_cnt; int dt_cnt; __ utils.h #define GET_RIP_CNT(ch) ((ch)->player_specials->saved.rip_cnt) #define GET_KILL_CNT(ch) ((ch)->player_specials->saved.kill_cnt) #define GET_DT_CNT(ch) ((ch)->player_specials->saved.dt_cnt) __ players.c load_char GET_RIP_CNT(ch) = 0; GET_KILL_CNT(ch) = 0; GET_DT_CNT(ch) = 0; case 'K': if (!strcmp(tag, "KilC")) GET_KILL_CNT(ch) = atoi(line); break; in case D else if (!strcmp(tag, "DtC ")) GET_DT_CNT(ch) = atoi(line); in case R else if(!strcmp(tag, "RipC")) GET_RIP_CNT(ch) = atoi(line); save_char: if (GET_RIP_CNT(ch) != 0) fprintf(fl, "RipC: %d\n", GET_RIP_CNT(ch)); if (GET_KILL_CNT(ch) != 0) fprintf(fl, "KilC: %d\n", GET_KILL_CNT(ch)); if (GET_DT_CNT(ch) != 0) fprintf(fl, "DtC : %d\n", GET_DT_CNT(ch)); __ Add the following right before the character is extracted when walking into a deathtrap. act.movement.c GET_DT_CNT(ch) += 1; __ fight.c void die(struct char_data * ch, struct char_data * killer) { gain_exp(ch, -(GET_EXP(ch) / 2)); if (!IS_NPC(ch)) { GET_RIP_CNT(ch) = GET_RIP_CNT(ch) + 1; REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_KILLER); REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_THIEF); } raw_kill(ch, killer); if (!IS_NPC(killer)) GET_KILL_CNT(killer) = GET_KILL_CNT(killer) + 1; } __ class.c GET_RIP_CNT(ch) = 0; GET_KILL_CNT(ch) = 0; GET_DT_CNT(ch) = 0; __ do.score send_to_char(ch, "You have died %d times, killed %d opponents and walked into a deathtrap %d times.\r\n", GET_RIP_CNT(ch), GET_KILL_CNT(ch), GET_DT_CNT(ch)); __
Last edit: 25 May 2016 23:17 by JTP.

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

More
25 May 2016 23:17 #5944 by rudeboyrave
Replied by rudeboyrave on topic Old patch from 1997
looks pretty clean to me. could you show me in context where the act.movement.c line is added? before the extract?

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

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

More
25 May 2016 23:19 #5945 by JTP
Replied by JTP on topic Old patch from 1997
yes just before extract

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

More
25 May 2016 23:28 - 25 May 2016 23:31 #5946 by rudeboyrave
Replied by rudeboyrave on topic Old patch from 1997
load_char
GET_RIP_CNT(ch) = 0;
GET_KILL_CNT(ch) = 0;
GET_DT_CNT(ch) = 0;

this should not be in load_char, put only in do_start because it is resetting every login maybe?

if added to do_start it would only be set to 0 when a char is made.

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
Last edit: 25 May 2016 23:31 by rudeboyrave.

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

Time to create page: 0.259 seconds