summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-08 17:41:49 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-08 17:41:49 +0000
commit32d8ac256193c2caf9fe705b377739bbde541dc8 (patch)
tree7118dc27e4a4fa1b6860aa6a866bee110ac06a7b /src/map/guild.c
parent83c079bdb0de26af96c2da4155c384663b0e9945 (diff)
downloadhercules-32d8ac256193c2caf9fe705b377739bbde541dc8.tar.gz
hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.tar.bz2
hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.tar.xz
hercules-32d8ac256193c2caf9fe705b377739bbde541dc8.zip
* Cleaned up junk left in the code by the mapcache/mapindex update
- Added mapindex_getmapname(_ext) to help with ".gat" adding/removing - Moved related processing to the interface (prevents duplicity) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10963 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 57582b470..ba0fc2829 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -12,6 +12,7 @@
#include "../common/mapindex.h"
#include "../common/showmsg.h"
#include "../common/ers.h"
+#include "../common/strlib.h"
#include "map.h"
#include "guild.h"
@@ -184,9 +185,9 @@ static int guild_read_castledb(void)
gc=(struct guild_castle *)aCalloc(1,sizeof(struct guild_castle));
gc->castle_id=atoi(str[0]);
- memcpy(gc->map_name,mapindex_normalize_name(str[1]),MAP_NAME_LENGTH);
- memcpy(gc->castle_name,str[2],NAME_LENGTH);
- memcpy(gc->castle_event,str[3],NAME_LENGTH);
+ safestrncpy(gc->map_name,mapindex_getmapname(str[1],NULL),MAP_NAME_LENGTH);
+ safestrncpy(gc->castle_name,str[2],NAME_LENGTH);
+ safestrncpy(gc->castle_event,str[3],NAME_LENGTH);
idb_put(castle_db,gc->castle_id,gc);
@@ -250,15 +251,13 @@ struct guild_castle *guild_castle_search(int gcid)
}
// mapnameに対応したアジトのgcを返す
-struct guild_castle *guild_mapname2gc(char *mapname)
+struct guild_castle* guild_mapname2gc(const char* mapname)
{
int i;
- struct guild_castle *gc=NULL;
-
- mapindex_normalize_name(mapname);
-
- for(i=0;i<MAX_GUILDCASTLE;i++){
- gc=guild_castle_search(i);
+ for(i = 0; i < MAX_GUILDCASTLE; i++)
+ {
+ struct guild_castle* gc;
+ gc = guild_castle_search(i);
if(!gc) continue;
if(strcmp(gc->map_name,mapname)==0) return gc;
}