summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-03 16:19:14 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-10-03 16:19:14 +0000
commitc2006cba2be4ba0588186a2f5f61cc7f73392b2b (patch)
tree56f567a48227df97e9171cb48d9f22af806fcfeb /src
parent6094568a44e60c0ac6021cb9b44973e325dcae6e (diff)
downloadhercules-c2006cba2be4ba0588186a2f5f61cc7f73392b2b.tar.gz
hercules-c2006cba2be4ba0588186a2f5f61cc7f73392b2b.tar.bz2
hercules-c2006cba2be4ba0588186a2f5f61cc7f73392b2b.tar.xz
hercules-c2006cba2be4ba0588186a2f5f61cc7f73392b2b.zip
- Reverted declaration of run_script to normal since it appears there's no longer any memory leaks related to it.
- Returned the MAX_PC_BONUS value to 10. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8928 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c4
-rw-r--r--src/map/clif.c9
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/script.c16
-rw-r--r--src/map/script.h3
5 files changed, 14 insertions, 20 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index a981f7e84..d0bf422e0 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -808,7 +808,7 @@ is_atcommand(const int fd, struct map_session_data* sd, const char* message, int
return AtCommand_None;
if (!gmlvl) gmlvl = pc_isGM(sd);
- type = atcommand(sd, gmlvl, str, &info);
+ type = atcommand(sd, gmlvl, str, &info);
if (type != AtCommand_None) {
char command[100];
const char* p = str;
@@ -7480,7 +7480,7 @@ atcommand_storeall(const int fd, struct map_session_data* sd,
return 0;
case 1: //Failure
clif_displaymessage(fd, "You can't open the storage currently.");
- return 1;
+ return -1;
}
}
for (i = 0; i < MAX_INVENTORY; i++) {
diff --git a/src/map/clif.c b/src/map/clif.c
index 9252c2404..4cc22f5cb 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8658,10 +8658,6 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
sd->cantalk_tick = gettick() + battle_config.min_chat_delay;
}
- memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
- WFIFOW(fd,0) = 0x8e;
- WFIFOSET(fd, WFIFOW(fd,2));
-
if (RFIFOW(fd,2)+4 < 128)
buf = buf2; //Use a static buffer.
else
@@ -8676,6 +8672,11 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
if(buf != buf2) aFree(buf);
+ // send back message to the speaker
+ memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
+ WFIFOW(fd,0) = 0x8e;
+ WFIFOSET(fd, WFIFOW(fd,2));
+
#ifdef PCRE_SUPPORT
map_foreachinrange(npc_chat_sub, &sd->bl, AREA_SIZE, BL_NPC, message, strlen(message), &sd->bl);
map_foreachinrange(mob_chat_sub, &sd->bl, AREA_SIZE, BL_MOB, message, strlen(message), &sd->bl);
diff --git a/src/map/map.h b/src/map/map.h
index 2448cf767..2d0875cce 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -55,7 +55,7 @@
#define MAX_VENDING 12
#define MOBID_EMPERIUM 1288
-#define MAX_PC_BONUS 15
+#define MAX_PC_BONUS 10
//Designed for search functions, species max number of matches to display.
#define MAX_SEARCH 5
#define MAX_DUEL 1024
diff --git a/src/map/script.c b/src/map/script.c
index 09fb80b32..58c72d3bf 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2511,9 +2511,7 @@ int run_func(struct script_state *st)
*/
void run_script_main(struct script_state *st);
-//FIXME: Temporary replacement to locate the leak source.
-//void run_script(struct script_code *rootscript,int pos,int rid,int oid)
-void run_script_sub(struct script_code *rootscript,int pos,int rid,int oid, char* file, int lineno)
+void run_script(struct script_code *rootscript,int pos,int rid,int oid)
{
struct script_state *st;
struct map_session_data *sd=NULL;
@@ -2526,18 +2524,14 @@ void run_script_sub(struct script_code *rootscript,int pos,int rid,int oid, char
//Resume script.
st = sd->st;
} else {
-// st = aCalloc(sizeof(struct script_state), 1);
- st = _mcalloc(sizeof(struct script_state), 1, file, lineno, __func__);
+ st = aCalloc(sizeof(struct script_state), 1);
// the script is different, make new script_state and stack
-// st->stack = aMalloc (sizeof(struct script_stack));
- st->stack = _mmalloc(sizeof(struct script_stack), file, lineno, __func__);
+ st->stack = aMalloc (sizeof(struct script_stack));
st->stack->sp=0;
st->stack->sp_max=64;
-// st->stack->stack_data = (struct script_data *)aCalloc(st->stack->sp_max,sizeof(st->stack->stack_data[0]));
- st->stack->stack_data = (struct script_data *)_mcalloc(st->stack->sp_max,sizeof(st->stack->stack_data[0]), file, lineno, __func__);
+ st->stack->stack_data = (struct script_data *)aCalloc(st->stack->sp_max,sizeof(st->stack->stack_data[0]));
st->stack->defsp = st->stack->sp;
-// st->stack->var_function = aCalloc(1, sizeof(struct linkdb_node*));
- st->stack->var_function = _mcalloc(1, sizeof(struct linkdb_node*), file, lineno, __func__);
+ st->stack->var_function = aCalloc(1, sizeof(struct linkdb_node*));
st->state = RUN;
st->script = rootscript;
}
diff --git a/src/map/script.h b/src/map/script.h
index 9970937a5..9fcd2f739 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -63,8 +63,7 @@ struct script_state {
struct script_code* parse_script(unsigned char *,const char*,int);
void run_script_sub(struct script_code *rootscript,int pos,int rid,int oid, char* file, int lineno);
-//void run_script(struct script_code*,int,int,int);
-#define run_script(sc,pos,rid,oid) run_script_sub(sc,pos,rid,oid,__FILE__,__LINE__)
+void run_script(struct script_code*,int,int,int);
int set_var(struct map_session_data *sd, char *name, void *val);
int conv_num(struct script_state *st,struct script_data *data);