diff options
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 8b1f39b72..cd6e0b997 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1232,7 +1232,7 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list) for(i=0;i<n;i++) {
struct item item_tmp;
- memset(&item_tmp,0,sizeof(item_tmp));
+ malloc_set(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = item_list[i*2+1];
item_tmp.identify = 1; // npc販売アイテムは鑑定済み
@@ -1797,7 +1797,7 @@ static int npc_skip_script (char *w1,char *w2,char *w3,char *w4,char *first_line if (strlen((char *)srcbuf) + strlen((char *)line) + 1 >= (size_t)srcsize) {
srcsize += 65536;
srcbuf = (unsigned char *)aRealloc(srcbuf, srcsize);
- memset(srcbuf + srcsize - 65536, '\0', 65536);
+ malloc_tsetdword(srcbuf + srcsize - 65536, '\0', 65536);
}
if (srcbuf[0] != '{') {
if (strchr((char *) line,'{')) {
@@ -1861,7 +1861,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line if (strlen((char *)srcbuf) + strlen((char *)line) + 1 >= (size_t)srcsize) {
srcsize += 65536;
srcbuf = (unsigned char *)aRealloc(srcbuf, srcsize);
- memset(srcbuf + srcsize - 65536, '\0', 65536);
+ malloc_tsetdword(srcbuf + srcsize - 65536, '\0', 65536);
}
if (srcbuf[0] != '{') {
if (strchr((char *) line,'{')) {
@@ -2097,7 +2097,7 @@ static int npc_parse_function (char *w1, char *w2, char *w3, char *w4, char *fir if (strlen(srcbuf)+strlen(line)+1 >= (unsigned int)srcsize) {
srcsize += 65536;
srcbuf = (char *)aRealloc(srcbuf, srcsize);
- memset(srcbuf + srcsize - 65536, '\0', 65536);
+ malloc_tsetdword(srcbuf + srcsize - 65536, '\0', 65536);
}
if (srcbuf[0]!='{') {
if (strchr(line,'{')) {
@@ -2172,7 +2172,7 @@ int npc_parse_mob (char *w1, char *w2, char *w3, char *w4) char mobname[NAME_LENGTH];
struct spawn_data mob, *data;
- memset(&mob, 0, sizeof(struct spawn_data));
+ malloc_set(&mob, 0, sizeof(struct spawn_data));
// 引数の個数チェック
if (sscanf(w1, "%15[^,],%d,%d,%d,%d", mapname, &x, &y, &xs, &ys) < 3 ||
@@ -2805,7 +2805,7 @@ int npc_reload (void) if(battle_config.dynamic_mobs) { //dynamic check by [random]
for (i = 0; i < MAX_MOB_LIST_PER_MAP; i++)
if (map[m].moblist[i]) aFree(map[m].moblist[i]);
- memset (map[m].moblist, 0, sizeof(map[m].moblist));
+ malloc_set (map[m].moblist, 0, sizeof(map[m].moblist));
}
if (map[m].npc_num > 0 && battle_config.error_log)
ShowWarning("npc_reload: %d npcs weren't removed at map %s!\n", map[m].npc_num, map[m].name);
@@ -2945,7 +2945,7 @@ int do_init_npc(void) char c = '-';
//Stock view data for normal npcs.
- memset(&npc_viewdb, 0, sizeof(npc_viewdb));
+ malloc_set(&npc_viewdb, 0, sizeof(npc_viewdb));
npc_viewdb[0].class_ = INVISIBLE_CLASS; //Invisible class is stored here.
for (busy = 1; busy < MAX_NPC_CLASS; busy++)
npc_viewdb[busy].class_ = busy;
@@ -2959,7 +2959,7 @@ int do_init_npc(void) ev_db = db_alloc(__FILE__,__LINE__,DB_STRING,DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA,51);
npcname_db = db_alloc(__FILE__,__LINE__,DB_STRING,DB_OPT_BASE,NAME_LENGTH);
- memset(&ev_tm_b, -1, sizeof(ev_tm_b));
+ malloc_set(&ev_tm_b, -1, sizeof(ev_tm_b));
timer_event_ers = ers_new((uint32)sizeof(struct timer_event_data));
for (nsl = npc_src_first; nsl; nsl = nsl->next) {
@@ -2993,7 +2993,7 @@ int do_init_npc(void) CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
npc_id - START_NPC_NUM, "", npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
- memset(script_event, 0, sizeof(script_event));
+ malloc_set(script_event, 0, sizeof(script_event));
npc_read_event_script();
//Debug function to locate all endless loop warps.
if (battle_config.warp_point_debug)
|