Fixed unaffect and 2 memory leaks --Rumble

This commit is contained in:
Rumble
2010-06-20 04:43:32 +00:00
parent b55af08002
commit 4b44a1a097
8 changed files with 36 additions and 8 deletions

View File

@@ -35,10 +35,16 @@ export (QQ's a zone into a tarball)
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist) Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too) (lots of major bugfixes too)
@ @
[Jun 20 2010] - Rumble
Fixed two memory leaks. (thanks Dio)
[Jum 19 2010] - Fizban [Jum 19 2010] - Fizban
Changed Helpcheck from level 34 to level 32. Changed Helpcheck from level 34 to level 32.
[Jun 07 2010] - Fizban [Jun 07 2010] - Fizban
Enabled nohassled immortals to give cursed items to other players. Enabled nohassled immortals to give cursed items to other players.
[Jun 18 2010] - Rumble
Fixed unaffect clearing ch affects and not vict. (thanks Drefs)
[May 24 2010] - Rumble
Fixed bug in redit copy duplicating people in room. (thanks Anderyu)
[May 19 2010] - Rumble [May 19 2010] - Rumble
Gave Arne Troffaes proper credit for fixing Cygwin syslog rotation. Gave Arne Troffaes proper credit for fixing Cygwin syslog rotation.
[May 16 2010] - Rumble [May 16 2010] - Rumble

View File

@@ -1,8 +1,8 @@
Text test 5~ Text stuck in a room with no exits~
Body test5 Body I'm stuck in a room, that I suspect was supposed to be a death trap, in the deep, dark forest. three huge poinsonous spiders attacked me but I didn't die and now I'm in a room with no exits.
~ ~
Name Rumble~ Name Stickley~
Level 34 Level 8
Room 1204 Room 6131
Flags 0 0 0 0 Flags 0 0 0 0
End End

View File

@@ -2341,7 +2341,7 @@ ACMD(do_wizutil)
while (vict->affected) while (vict->affected)
affect_remove(vict, vict->affected); affect_remove(vict, vict->affected);
for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) for(taeller=0; taeller < AF_ARRAY_MAX; taeller++)
AFF_FLAGS(ch)[taeller] = 0; AFF_FLAGS(vict)[taeller] = 0;
send_to_char(vict, "There is a brief flash of light!\r\nYou feel slightly different.\r\n"); send_to_char(vict, "There is a brief flash of light!\r\nYou feel slightly different.\r\n");
send_to_char(ch, "All spells removed.\r\n"); send_to_char(ch, "All spells removed.\r\n");
} else { } else {

View File

@@ -80,6 +80,7 @@
#include "spells.h" /* for affect_update */ #include "spells.h" /* for affect_update */
#include "modify.h" #include "modify.h"
#include "quest.h" #include "quest.h"
#include "ibt.h" /* for free_ibt_lists */
#ifndef INVALID_SOCKET #ifndef INVALID_SOCKET
#define INVALID_SOCKET (-1) #define INVALID_SOCKET (-1)
@@ -365,6 +366,7 @@ int main(int argc, char **argv)
free_invalid_list(); /* ban.c */ free_invalid_list(); /* ban.c */
free_save_list(); /* genolc.c */ free_save_list(); /* genolc.c */
free_strings(&config_info, OASIS_CFG); /* oasis_delete.c */ free_strings(&config_info, OASIS_CFG); /* oasis_delete.c */
free_ibt_lists(); /* ibt.c */
} }
if (last_act_message) if (last_act_message)

View File

@@ -1036,7 +1036,6 @@ void index_boot(int mode)
/* Sort the help index. */ /* Sort the help index. */
if (mode == DB_BOOT_HLP) { if (mode == DB_BOOT_HLP) {
qsort(help_table, top_of_helpt, sizeof(struct help_index_element), hsort); qsort(help_table, top_of_helpt, sizeof(struct help_index_element), hsort);
top_of_helpt--;
} }
} }

View File

@@ -1019,3 +1019,17 @@ void ibtedit_string_cleanup(struct descriptor_data *d, int terminator)
break; break;
} }
} }
/*-------------------------------------------------------------------*/
void free_ibt_lists()
{
IBT_DATA *first_ibt, *last_ibt;
int mode;
for( mode=0; mode <=2; mode++){
first_ibt = get_first_ibt(mode);
last_ibt = get_last_ibt(mode);
free_ibt_list(first_ibt, last_ibt);
}
}

View File

@@ -96,4 +96,4 @@ void save_ibt_file(int mode);
void load_ibt_file(int mode); void load_ibt_file(int mode);
void ibtedit_parse(struct descriptor_data *d, char *arg); void ibtedit_parse(struct descriptor_data *d, char *arg);
void ibtedit_string_cleanup(struct descriptor_data *d, int terminator); void ibtedit_string_cleanup(struct descriptor_data *d, int terminator);
void free_ibt_lists();

View File

@@ -170,6 +170,13 @@ void redit_setup_existing(struct descriptor_data *d, int real_num)
CREATE(room, struct room_data, 1); CREATE(room, struct room_data, 1);
*room = world[real_num]; *room = world[real_num];
/* Make new room people list be empty. */
/* Fixes bug where copying a room from within that room creates */
/* an infinite loop when you next act() in the new room (goto?) */
/* and you are your next_in_room -- anderyu (10-05-22) */
room->people = NULL;
/* Allocate space for all strings. */ /* Allocate space for all strings. */
room->name = str_udup(world[real_num].name); room->name = str_udup(world[real_num].name);
room->description = str_udup(world[real_num].description); room->description = str_udup(world[real_num].description);