From 3c8999edce9e1f0d5c0dee3ff8311e781d64c684 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 27 Aug 2006 06:38:17 +0000 Subject: * Optional macro MEMSET_TURBO for faster low-level memory initializations. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8499 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pet.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/map/pet.c') diff --git a/src/map/pet.c b/src/map/pet.c index b54f5cf6f..cf5266047 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -343,7 +343,7 @@ static int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) int flag; pet_lootitem_drop(pd,sd); - memset(&tmp_item,0,sizeof(tmp_item)); + malloc_set(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = pd->petDB->EggID; tmp_item.identify = 1; tmp_item.card[0] = CARD0_PET; @@ -633,7 +633,7 @@ int pet_get_egg(int account_id,int pet_id,int flag) return 0; } - memset(&tmp_item,0,sizeof(tmp_item)); + malloc_set(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = pet_db[i].EggID; tmp_item.identify = 1; tmp_item.card[0] = CARD0_PET; @@ -761,7 +761,7 @@ static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) pd->pet.equip = 0; status_set_viewdata(&pd->bl, pd->pet.class_); clif_pet_equip(pd); - memset(&tmp_item,0,sizeof(tmp_item)); + malloc_set(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = nameid; tmp_item.identify = 1; if((flag = pc_additem(sd,&tmp_item,1))) { @@ -1080,7 +1080,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd) } } //The smart thing to do is use pd->loot->max (thanks for pointing it out, Shinomori) - memset(pd->loot->item,0,pd->loot->max * sizeof(struct item)); + malloc_set(pd->loot->item,0,pd->loot->max * sizeof(struct item)); pd->loot->count = 0; pd->loot->weight = 0; pd->ud.canact_tick = gettick()+10000; // 10*1000msの間拾わない @@ -1278,7 +1278,7 @@ int read_petdb() pet_db[j].script = NULL; } j = 0; - memset(pet_db,0,sizeof(pet_db)); + malloc_set(pet_db,0,sizeof(pet_db)); for(i=0;i<2;i++){ sprintf(line, "%s/%s", db_path, filename[i]); fp=fopen(line,"r"); @@ -1354,7 +1354,7 @@ int read_petdb() */ int do_init_pet(void) { - memset(pet_db,0,sizeof(pet_db)); + malloc_set(pet_db,0,sizeof(pet_db)); read_petdb(); item_drop_ers = ers_new((uint32)sizeof(struct item_drop)); -- cgit v1.2.3-60-g2f50