summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorDracoRPG <DracoRPG@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-06 17:22:40 +0000
committerDracoRPG <DracoRPG@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-06 17:22:40 +0000
commitded1f674755335a9cbb5c08e321b4a4c092a0e8d (patch)
tree4ff5231731935b41f9ef1fdccf9b14ef5b4e85b3 /src/map/script.c
parent2d75543b172d4cf141278bbd224e2353f19b5c86 (diff)
downloadhercules-ded1f674755335a9cbb5c08e321b4a4c092a0e8d.tar.gz
hercules-ded1f674755335a9cbb5c08e321b4a4c092a0e8d.tar.bz2
hercules-ded1f674755335a9cbb5c08e321b4a4c092a0e8d.tar.xz
hercules-ded1f674755335a9cbb5c08e321b4a4c092a0e8d.zip
I'm still here!
Rewrote fame ranking lists- changed MAP_NAME_LENGTH to 12, now there's MAP_NAME_LENGTH_EXT at 16 for uses where there is / may be the .gat extension, code adjusted accordingly - moved map_normalize_name to mapindex_normalize_name so that everything handling map names uses the same extension-removing function - greatly enhanced the map cache generator, complete documentation on the tool and the map cache format can be found in doc/ - the map cache format changed a bit as a consequence, but of course a new valid one is included (contains latest Nameless Island maps) - fixed a duplicate entry in map index git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10167 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b0f582b58..602020cf2 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9119,10 +9119,10 @@ BUILDIN_FUNC(flagemblem)
BUILDIN_FUNC(getcastlename)
{
- char mapname[MAP_NAME_LENGTH];
+ char mapname[MAP_NAME_LENGTH_EXT];
struct guild_castle *gc;
- strncpy(mapname, script_getstr(st,2), MAP_NAME_LENGTH);
+ strncpy(mapname, script_getstr(st,2), MAP_NAME_LENGTH_EXT);
gc = guild_mapname2gc(mapname);
if(gc)
@@ -9134,13 +9134,13 @@ BUILDIN_FUNC(getcastlename)
BUILDIN_FUNC(getcastledata)
{
- char mapname[MAP_NAME_LENGTH];
+ char mapname[MAP_NAME_LENGTH_EXT];
int index=script_getnum(st,3);
const char *event=NULL;
struct guild_castle *gc;
int i;
- strncpy(mapname, script_getstr(st,2), MAP_NAME_LENGTH);
+ strncpy(mapname, script_getstr(st,2), MAP_NAME_LENGTH_EXT);
gc = guild_mapname2gc(mapname);
if(script_hasdata(st,4) && index==0 && gc) {
@@ -9202,12 +9202,12 @@ BUILDIN_FUNC(getcastledata)
BUILDIN_FUNC(setcastledata)
{
- char mapname[MAP_NAME_LENGTH];
+ char mapname[MAP_NAME_LENGTH_EXT];
int index=script_getnum(st,3);
int value=script_getnum(st,4);
struct guild_castle *gc;
- strncpy(mapname, script_getstr(st,2), MAP_NAME_LENGTH);
+ strncpy(mapname, script_getstr(st,2), MAP_NAME_LENGTH_EXT);
gc = guild_mapname2gc(mapname);
if(gc) {
@@ -11084,9 +11084,9 @@ BUILDIN_FUNC(getsavepoint)
y=sd->status.save_point.y;
switch(type){
case 0:
- mapname=(char *) aMallocA((MAP_NAME_LENGTH+1)*sizeof(char));
+ mapname=(char *) aMallocA((MAP_NAME_LENGTH)*sizeof(char));
memcpy(mapname, mapindex_id2name(sd->status.save_point.map), MAP_NAME_LENGTH);
- mapname[MAP_NAME_LENGTH]='\0';
+ mapname[MAP_NAME_LENGTH-1]='\0';
script_pushstr(st,mapname);
break;
case 1:
@@ -11133,7 +11133,7 @@ BUILDIN_FUNC(getmapxy)
char prefix;
int x,y,type;
- char mapname[MAP_NAME_LENGTH+1];
+ char mapname[MAP_NAME_LENGTH];
memset(mapname, 0, sizeof(mapname));
if( !data_isreference(script_getdata(st,2)) ){