summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c10
-rw-r--r--src/map/intif.c3
-rw-r--r--src/map/itemdb.c2
-rw-r--r--src/map/map.c20
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/npc.c12
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/script.c8
-rw-r--r--src/map/skill.c10
-rw-r--r--src/map/storage.c5
10 files changed, 42 insertions, 40 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f7ca80a93..765ce9443 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -5416,11 +5416,11 @@ void battle_set_defaults() {
battle_config.natural_heal_skill_interval=10000;
battle_config.natural_heal_weight_rate=50;
battle_config.item_name_override_grffile=1;
- battle_config.item_equip_override_grffile=1; // [Celest]
- battle_config.item_slots_override_grffile=1; // [Celest]
- battle_config.indoors_override_grffile=1; // [Celest]
- battle_config.skill_sp_override_grffile=1; // [Celest]
- battle_config.cardillust_read_grffile=1; // [Celest]
+ battle_config.item_equip_override_grffile=0; // [Celest]
+ battle_config.item_slots_override_grffile=0; // [Celest]
+ battle_config.indoors_override_grffile=0; // [Celest]
+ battle_config.skill_sp_override_grffile=0; // [Celest]
+ battle_config.cardillust_read_grffile=0; // [Celest]
battle_config.arrow_decrement=1;
battle_config.max_aspd = 199;
battle_config.max_hp = 32500;
diff --git a/src/map/intif.c b/src/map/intif.c
index 28f1b65a2..379589556 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -31,6 +31,7 @@
#include "guild.h"
#include "pet.h"
#include "nullpo.h"
+#include "malloc.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -691,7 +692,7 @@ int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B
struct map_session_data *pl_sd;
char Wisp_name[24];
char mbuf[255];
- char *message = ((RFIFOW(fd,2) - 30) >= sizeof(mbuf)) ? (char *) malloc((RFIFOW(fd,2) - 30)) : mbuf;
+ char *message = ((RFIFOW(fd,2) - 30) >= sizeof(mbuf)) ? (char *) aMalloc((RFIFOW(fd,2) - 30)) : mbuf;
min_gm_level = (int)RFIFOW(fd,28);
memcpy(Wisp_name, RFIFOP(fd,4), 24);
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index cf6ab52d0..815034d8c 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -764,7 +764,7 @@ static int itemdb_read_sqldb(void)
// Insert a new row into the item database
- /*id = calloc(sizeof(struct item_data), 1);
+ /*id = aCalloc(sizeof(struct item_data), 1);
if (id == NULL)
{
diff --git a/src/map/map.c b/src/map/map.c
index d89bf424d..91f82110f 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1769,7 +1769,7 @@ static int map_readafm(int m,char *fn) {
map[m].m = m;
xs = map[m].xs = afm_size[0];
ys = map[m].ys = afm_size[1];
- map[m].gat = calloc(s = map[m].xs * map[m].ys, 1);
+ map[m].gat = aCalloc(s = map[m].xs * map[m].ys, 1);
if(map[m].gat==NULL){
printf("out of memory : map_readmap gat\n");
@@ -1792,14 +1792,14 @@ static int map_readafm(int m,char *fn) {
map[m].bxs=(xs+BLOCK_SIZE-1)/BLOCK_SIZE;
map[m].bys=(ys+BLOCK_SIZE-1)/BLOCK_SIZE;
size = map[m].bxs * map[m].bys * sizeof(struct block_list*);
- map[m].block = calloc(size, 1);
+ map[m].block = aCalloc(size, 1);
if(map[m].block == NULL){
printf("out of memory : map_readmap block\n");
exit(1);
}
- map[m].block_mob = calloc(size, 1);
+ map[m].block_mob = aCalloc(size, 1);
if (map[m].block_mob == NULL) {
printf("out of memory : map_readmap block_mob\n");
exit(1);
@@ -1807,14 +1807,14 @@ static int map_readafm(int m,char *fn) {
size = map[m].bxs*map[m].bys*sizeof(int);
- map[m].block_count = calloc(size, 1);
+ map[m].block_count = aCalloc(size, 1);
if(map[m].block_count==NULL){
printf("out of memory : map_readmap block\n");
exit(1);
}
memset(map[m].block_count,0,size);
- map[m].block_mob_count=calloc(size, 1);
+ map[m].block_mob_count=aCalloc(size, 1);
if(map[m].block_mob_count==NULL){
printf("out of memory : map_readmap block_mob\n");
exit(1);
@@ -2067,15 +2067,15 @@ int parse_console(char *buf) {
int m, n;
struct map_session_data *sd;
- sd = calloc(sizeof(*sd), 1);
+ sd = aCalloc(sizeof(*sd), 1);
sd->fd = 0;
strcpy( sd->status.name , "console");
- type = (char *)malloc(64);
- command = (char *)malloc(64);
- map = (char *)malloc(64);
- buf2 = (char *)malloc(72);
+ type = (char *)aMalloc(64);
+ command = (char *)aMalloc(64);
+ map = (char *)aMalloc(64);
+ buf2 = (char *)aMalloc(72);
memset(type,0,64);
memset(command,0,64);
diff --git a/src/map/mob.c b/src/map/mob.c
index 3c3fc76a5..f9b049254 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -286,7 +286,7 @@ int mob_spawn_guardian(struct map_session_data *sd,char *mapname,
for(count=0;count<amount;count++){
struct guild_castle *gc;
- md=calloc(sizeof(struct mob_data), 1);
+ md=aCalloc(sizeof(struct mob_data), 1);
if(md==NULL){
printf("mob_spawn_guardian: out of memory !\n");
exit(1);
diff --git a/src/map/npc.c b/src/map/npc.c
index 9068909ea..4f6fa42ad 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -245,8 +245,8 @@ int npc_event_export(void *key,void *data,va_list ap)
char *buf;
char *p=strchr(lname,':');
// エクスポートされる
- ev=calloc(sizeof(struct event_data), 1);
- buf=calloc(50, 1);
+ ev=aCalloc(sizeof(struct event_data), 1);
+ buf=aCalloc(50, 1);
if (ev==NULL || buf==NULL) {
printf("npc_event_export: out of memory !\n");
exit(1);
@@ -460,7 +460,7 @@ int npc_addeventtimer(struct npc_data *nd,int tick,const char *name)
if( nd->eventtimer[i]==-1 )
break;
if(i<MAX_EVENTTIMER){
- char *evname=malloc(24);
+ char *evname=aMalloc(24);
if(evname==NULL){
printf("npc_addeventtimer: out of memory !\n");exit(1);
}
@@ -546,8 +546,8 @@ int npc_timerevent_import(void *key,void *data,va_list ap)
// タイマーイベント
struct npc_timerevent_list *te=nd->u.scr.timer_event;
int j,i=nd->u.scr.timeramount;
- if(te==NULL) te=malloc(sizeof(struct npc_timerevent_list));
- else te=realloc( te, sizeof(struct npc_timerevent_list) * (i+1) );
+ if(te==NULL) te=aMalloc(sizeof(struct npc_timerevent_list));
+ else te=aRealloc( te, sizeof(struct npc_timerevent_list) * (i+1) );
if(te==NULL){
printf("npc_timerevent_import: out of memory !\n");
exit(1);
@@ -1777,7 +1777,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
}else{
// duplicate
-// nd->u.scr.label_list=malloc(sizeof(struct npc_label_list)*label_dupnum);
+// nd->u.scr.label_list=aMalloc(sizeof(struct npc_label_list)*label_dupnum);
// memcpy(nd->u.scr.label_list,label_dup,sizeof(struct npc_label_list)*label_dupnum);
nd->u.scr.label_list=label_dup; // ラベルデータ共有
diff --git a/src/map/pc.c b/src/map/pc.c
index ccf163f4e..f7837f838 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -126,7 +126,7 @@ int pc_set_gm_level(int account_id, int level) {
}
GM_num++;
- gm_account = realloc(gm_account, sizeof(struct gm_account) * GM_num);
+ gm_account = aRealloc(gm_account, sizeof(struct gm_account) * GM_num);
gm_account[GM_num - 1].account_id = account_id;
gm_account[GM_num - 1].level = level;
return 0;
@@ -6430,7 +6430,7 @@ int pc_setreg(struct map_session_data *sd,int reg,int val)
}
}
sd->reg_num++;
- sd->reg = realloc(sd->reg, sizeof(*(sd->reg)) * sd->reg_num);
+ sd->reg = aRealloc(sd->reg, sizeof(*(sd->reg)) * sd->reg_num);
if (sd->reg == NULL){
printf("out of memory : pc_setreg\n");
exit(1);
@@ -6481,7 +6481,7 @@ int pc_setregstr(struct map_session_data *sd,int reg,char *str)
return 0;
}
sd->regstr_num++;
- sd->regstr = realloc(sd->regstr, sizeof(sd->regstr[0]) * sd->regstr_num);
+ sd->regstr = aRealloc(sd->regstr, sizeof(sd->regstr[0]) * sd->regstr_num);
if(sd->regstr==NULL){
printf("out of memory : pc_setreg\n");
exit(1);
@@ -7750,7 +7750,7 @@ int pc_read_gm_account(int fd)
free(gm_account);
GM_num = 0;
#ifdef TXT_ONLY
- gm_account = calloc(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1);
+ gm_account = aCalloc(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1);
for (i = 4; i < RFIFOW(fd,2); i = i + 5) {
gm_account[GM_num].account_id = RFIFOL(fd,i);
gm_account[GM_num].level = (int)RFIFOB(fd,i+4);
@@ -7764,7 +7764,7 @@ int pc_read_gm_account(int fd)
}
lsql_res = mysql_store_result(&lmysql_handle);
if (lsql_res) {
- gm_account = calloc(sizeof(struct gm_account) * mysql_num_rows(lsql_res), 1);
+ gm_account = aCalloc(sizeof(struct gm_account) * mysql_num_rows(lsql_res), 1);
while ((lsql_row = mysql_fetch_row(lsql_res))) {
gm_account[GM_num].account_id = atoi(lsql_row[0]);
gm_account[GM_num].level = atoi(lsql_row[1]);
diff --git a/src/map/script.c b/src/map/script.c
index c226473b5..91245d19e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5465,14 +5465,14 @@ int buildin_strmobinfo(struct script_state *st)
if(num==1) {
char *buf;
- buf=calloc(24, 1);
+ buf=aCalloc(24, 1);
buf=mob_db[class].name;
push_str(st->stack,C_STR,buf);
return 0;
}
else if(num==2) {
char *buf;
- buf=calloc(24, 1);
+ buf=aCalloc(24, 1);
buf=mob_db[class].jname;
push_str(st->stack,C_STR,buf);
return 0;
@@ -6137,7 +6137,7 @@ int buildin_getsavepoint(struct script_state *st)
sd=script_rid2sd(st);
type=conv_num(st,& (st->stack->stack_data[st->start+2]));
- mapname=calloc(24, 1);
+ mapname=aCalloc(24, 1);
x=sd->status.save_point.x;
y=sd->status.save_point.y;
@@ -6206,7 +6206,7 @@ int buildin_getmapxy(struct script_state *st){
//??????????? >>> Possible needly check function parameters on C_STR,C_INT,C_INT <<< ???????????//
type=conv_num(st,& (st->stack->stack_data[st->start+5]));
- mapname=calloc(24, 1);
+ mapname=aCalloc(24, 1);
switch (type){
case 0: //Get Character Position
diff --git a/src/map/skill.c b/src/map/skill.c
index 794059e82..1e1c373cb 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5598,7 +5598,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
group->range=range;
if(skillid==HT_TALKIEBOX ||
skillid==RG_GRAFFITI){
- group->valstr=calloc(80, 1);
+ group->valstr=aCalloc(80, 1);
if(group->valstr==NULL){
printf("skill_castend_map: out of memory !\n");
exit(1);
@@ -6547,7 +6547,7 @@ int skill_unit_onlimit(struct skill_unit *src,unsigned int tick)
src->bl.x,src->bl.y,1);
if(group == NULL)
return 0;
- group->valstr=calloc(24, 1);
+ group->valstr=aCalloc(24, 1);
if(group->valstr==NULL){
printf("skill_unit_onlimit: out of memory !\n");
exit(1);
@@ -11204,9 +11204,9 @@ int skill_unit_move_unit_group( struct skill_unit_group *group, int m,int dx,int
int i,j, *r_flag, *s_flag, *m_flag;
struct skill_unit *unit1;
struct skill_unit *unit2;
- r_flag = (int *) malloc(sizeof(int) * group->unit_count);
- s_flag = (int *) malloc(sizeof(int) * group->unit_count);
- m_flag = (int *) malloc(sizeof(int) * group->unit_count);
+ r_flag = (int *) aMalloc(sizeof(int) * group->unit_count);
+ s_flag = (int *) aMalloc(sizeof(int) * group->unit_count);
+ m_flag = (int *) aMalloc(sizeof(int) * group->unit_count);
memset(r_flag,0, sizeof(int) * group->unit_count);// ?承フラグ
memset(s_flag,0, sizeof(int) * group->unit_count);// ?承フラグ
memset(m_flag,0, sizeof(int) * group->unit_count);// ?承フラグ
diff --git a/src/map/storage.c b/src/map/storage.c
index bc97b1390..501a16709 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -11,6 +11,7 @@
#include "storage.h"
#include "guild.h"
#include "nullpo.h"
+#include "malloc.h"
#ifdef MEMWATCH
#include "memwatch.h"
@@ -71,7 +72,7 @@ struct storage *account2storage(int account_id)
struct storage *stor;
stor=numdb_search(storage_db,account_id);
if(stor == NULL) {
- stor = calloc(sizeof(struct storage), 1);
+ stor = aCalloc(sizeof(struct storage), 1);
if(stor == NULL){
printf("storage: out of memory!\n");
exit(0);
@@ -363,7 +364,7 @@ struct guild_storage *guild2storage(int guild_id)
if(guild_search(guild_id) != NULL) {
gs=numdb_search(guild_storage_db,guild_id);
if(gs == NULL) {
- gs = calloc(sizeof(struct guild_storage), 1);
+ gs = aCalloc(sizeof(struct guild_storage), 1);
if(gs==NULL){
printf("storage: out of memory!\n");
exit(0);