summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-09 01:49:50 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-09 01:49:50 +0000
commite7beef1499ae660af01f163a16b9040bd60d8845 (patch)
treecefcd0a5eff2a2f041ab5e07f6f14cbc8549d567 /src/map/script.c
parent6f96f2dea64de97bd5a16a146c8ce943b01563de (diff)
downloadhercules-e7beef1499ae660af01f163a16b9040bd60d8845.tar.gz
hercules-e7beef1499ae660af01f163a16b9040bd60d8845.tar.bz2
hercules-e7beef1499ae660af01f163a16b9040bd60d8845.tar.xz
hercules-e7beef1499ae660af01f163a16b9040bd60d8845.zip
- Added info on packet 0x86 (simple move packet). Not usable until a clear separation between entering sight/leaving sight/walking in sight is done.
- Propagating const char* from the script engine. - ".gat" is appended to the map name before sending the changemapserver packet to the client. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9979 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 57a738d28..eb1bc4609 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4245,7 +4245,7 @@ BUILDIN_FUNC(callfunc)
struct script_code *scr, *oldscr;
const char *str=conv_str(st,& (st->stack->stack_data[st->start+2]));
- if( (scr=strdb_get(userfunc_db,str)) ){
+ if( (scr=strdb_get(userfunc_db,(unsigned char*)str)) ){
int i,j;
struct linkdb_node **oldval = st->stack->var_function;
for(i=st->start+3,j=0;i<st->end;i++,j++)
@@ -9141,12 +9141,14 @@ BUILDIN_FUNC(getcastlename)
BUILDIN_FUNC(getcastledata)
{
- const char *mapname=conv_str(st,& (st->stack->stack_data[st->start+2]));
+ char mapname[MAP_NAME_LENGTH+1];
int index=conv_num(st,& (st->stack->stack_data[st->start+3]));
const char *event=NULL;
struct guild_castle *gc;
int i,j;
+ strncpy(mapname, conv_str(st,script_getdata(st,2)), MAP_NAME_LENGTH);
+ mapname[MAP_NAME_LENGTH] = '\0';
map_normalize_name(mapname);
if( st->end>st->start+4 && index==0){
@@ -9206,12 +9208,14 @@ BUILDIN_FUNC(getcastledata)
BUILDIN_FUNC(setcastledata)
{
- const char *mapname=conv_str(st,& (st->stack->stack_data[st->start+2]));
+ char mapname[MAP_NAME_LENGTH+1];
int index=conv_num(st,& (st->stack->stack_data[st->start+3]));
int value=conv_num(st,& (st->stack->stack_data[st->start+4]));
struct guild_castle *gc;
int i;
+ strncpy(mapname, conv_str(st,script_getdata(st,2)), MAP_NAME_LENGTH);
+ mapname[MAP_NAME_LENGTH] = '\0';
map_normalize_name(mapname);
for(i=0;i<MAX_GUILDCASTLE;i++){
@@ -11751,7 +11755,6 @@ BUILDIN_FUNC(compare)
{
const char *message;
const char *cmpstring;
- int j;
message = conv_str(st,& (st->stack->stack_data[st->start+2]));
cmpstring = conv_str(st,& (st->stack->stack_data[st->start+3]));
push_val(st->stack,C_INT,(stristr(message,cmpstring) != NULL));
@@ -12374,7 +12377,7 @@ BUILDIN_FUNC(checkchatting) // check chatting [Marka]
return 0;
}
-int axtoi(char *hexStg)
+int axtoi(const char *hexStg)
{
int n = 0; // position in string
int m = 0; // position in digit[] to shift