summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2014-02-02 15:02:14 -0200
committershennetsind <ind@henn.et>2014-02-02 15:02:14 -0200
commitd33469689ea8e671fa0d525d54bce6932dfe9107 (patch)
treef6fc609df3a6d723f6390a69c8e8174e6a242b72 /src/map
parent8a05e611a71168cccac282777aa1719a46f574d0 (diff)
downloadhercules-d33469689ea8e671fa0d525d54bce6932dfe9107.tar.gz
hercules-d33469689ea8e671fa0d525d54bce6932dfe9107.tar.bz2
hercules-d33469689ea8e671fa0d525d54bce6932dfe9107.tar.xz
hercules-d33469689ea8e671fa0d525d54bce6932dfe9107.zip
Introducing HPM Datacheck
http://hercules.ws/board/topic/4283-introducing-hpm-datacheck/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/HPMmap.c71
-rw-r--r--src/map/HPMmap.h10
-rw-r--r--src/map/atcommand.h6
-rw-r--r--src/map/battle.h6
-rw-r--r--src/map/battleground.h6
-rw-r--r--src/map/buyingstore.h6
-rw-r--r--src/map/chat.h6
-rw-r--r--src/map/chrif.h6
-rw-r--r--src/map/clif.h6
-rw-r--r--src/map/date.h6
-rw-r--r--src/map/duel.h6
-rw-r--r--src/map/elemental.h6
-rw-r--r--src/map/guild.h6
-rw-r--r--src/map/homunculus.h6
-rw-r--r--src/map/instance.h6
-rw-r--r--src/map/intif.h6
-rw-r--r--src/map/irc-bot.h6
-rw-r--r--src/map/itemdb.h6
-rw-r--r--src/map/log.h6
-rw-r--r--src/map/mail.h6
-rw-r--r--src/map/map.c2
-rw-r--r--src/map/map.h6
-rw-r--r--src/map/mapreg.h6
-rw-r--r--src/map/mercenary.h6
-rw-r--r--src/map/mob.h6
-rw-r--r--src/map/npc.h6
-rw-r--r--src/map/packets.h6
-rw-r--r--src/map/packets_struct.h6
-rw-r--r--src/map/party.h6
-rw-r--r--src/map/path.h6
-rw-r--r--src/map/pc.h7
-rw-r--r--src/map/pc_groups.h6
-rw-r--r--src/map/pet.h6
-rw-r--r--src/map/quest.h6
-rw-r--r--src/map/script.h6
-rw-r--r--src/map/searchstore.h6
-rw-r--r--src/map/skill.h6
-rw-r--r--src/map/status.h6
-rw-r--r--src/map/storage.h6
-rw-r--r--src/map/trade.h7
-rw-r--r--src/map/unit.h11
-rw-r--r--src/map/vending.h6
42 files changed, 190 insertions, 134 deletions
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index 4b1338b8d..1688f37ce 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -34,6 +34,8 @@
#include <string.h>
#include <time.h>
+#include "../plugins/HPMDataCheck.h"
+
struct HPM_atcommand_list {
//tracking currently not enabled
// - requires modifying how plugins calls atcommand creation
@@ -46,6 +48,11 @@ struct HPM_atcommand_list {
struct HPM_atcommand_list *atcommand_list = NULL;
unsigned int atcommand_list_items = 0;
+/**
+ * (char*) data name -> (unsigned int) HPMDataCheck[] index
+ **/
+DBMap *datacheck_db;
+
bool HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
/* record address */
switch( type ) {
@@ -113,20 +120,28 @@ void HPM_map_atcommands(void) {
}
}
-void HPM_map_do_final(void) {
- unsigned char i;
+/**
+ * Called by HPM->DataCheck on a plugins incoming data, ensures data structs in use are matching!
+ **/
+bool HPM_map_DataCheck (struct s_HPMDataCheck *src, unsigned int size, char *name) {
+ unsigned int i, j;
- if( atcommand_list )
- aFree(atcommand_list);
- /**
- * why is pcg->HPM being cleared here? because PCG's do_final is not final,
- * is used on reload, and would thus cause plugin-provided permissions to go away
- **/
- for( i = 0; i < pcg->HPMpermissions_count; i++ ) {
- aFree(pcg->HPMpermissions[i].name);
+ for(i = 0; i < size; i++) {
+
+ if( !strdb_exists(datacheck_db, src[i].name) ) {
+ ShowError("HPMDataCheck:%s: '%s' was not found\n",name,src[i].name);
+ return false;
+ } else {
+ j = strdb_uiget(datacheck_db, src[i].name);/* not double lookup; exists sets cache to found data */
+ ShowDebug("Testing[%s/%s] %u vs %u\n",src[i].name,HPMDataCheck[j].name,src[i].size,HPMDataCheck[j].size);
+ if( src[i].size != HPMDataCheck[j].size ) {
+ ShowWarning("HPMDataCheck:%s: '%s' size mismatch %u != %u\n",name,src[i].name,src[i].size,HPMDataCheck[j].size);
+ return false;
+ }
+ }
}
- if( pcg->HPMpermissions )
- aFree(pcg->HPMpermissions);
+
+ return true;
}
/**
@@ -141,3 +156,35 @@ void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned in
pcg->HPMpermissions[index].name = aStrdup(name);
pcg->HPMpermissions[index].mask = mask;
}
+
+void HPM_map_do_init(void) {
+ unsigned int i;
+
+ /**
+ * Populates datacheck_db for easy lookup later on
+ **/
+ datacheck_db = strdb_alloc(DB_OPT_BASE,0);
+
+ for(i = 0; i < HPMDataCheckLen; i++) {
+ strdb_uiput(datacheck_db, HPMDataCheck[i].name, i);
+ }
+
+}
+
+void HPM_map_do_final(void) {
+ unsigned char i;
+
+ if( atcommand_list )
+ aFree(atcommand_list);
+ /**
+ * why is pcg->HPM being cleared here? because PCG's do_final is not final,
+ * is used on reload, and would thus cause plugin-provided permissions to go away
+ **/
+ for( i = 0; i < pcg->HPMpermissions_count; i++ ) {
+ aFree(pcg->HPMpermissions[i].name);
+ }
+ if( pcg->HPMpermissions )
+ aFree(pcg->HPMpermissions);
+
+ db_destroy(datacheck_db);
+}
diff --git a/src/map/HPMmap.h b/src/map/HPMmap.h
index ff8cf4c74..f291575fb 100644
--- a/src/map/HPMmap.h
+++ b/src/map/HPMmap.h
@@ -1,8 +1,8 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
-#ifndef _HPM_MAP_
-#define _HPM_MAP_
+#ifndef _MAP_HPMMAP_H_
+#define _MAP_HPMMAP_H_
#include "../common/cbasetypes.h"
#include "../map/atcommand.h"
@@ -22,4 +22,8 @@ void HPM_map_do_final(void);
void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned int *mask);
-#endif /* _HPM_MAP_ */
+bool HPM_map_DataCheck(struct s_HPMDataCheck *src, unsigned int size, char *name);
+
+void HPM_map_do_init(void);
+
+#endif /* _MAP_HPMMAP_H_ */
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index f95940924..39f7cc2b2 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _ATCOMMAND_H_
-#define _ATCOMMAND_H_
+#ifndef _MAP_ATCOMMAND_H_
+#define _MAP_ATCOMMAND_H_
#include "../common/conf.h"
#include "../common/db.h"
@@ -121,4 +121,4 @@ void atcommand_defaults(void);
/* stay here */
#define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info)
-#endif /* _ATCOMMAND_H_ */
+#endif /* _MAP_ATCOMMAND_H_ */
diff --git a/src/map/battle.h b/src/map/battle.h
index 98f2e37e8..0fcef7292 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _BATTLE_H_
-#define _BATTLE_H_
+#ifndef _MAP_BATTLE_H_
+#define _MAP_BATTLE_H_
#include "../common/cbasetypes.h"
#include "map.h" //ELE_MAX
@@ -596,4 +596,4 @@ struct battle_interface {
struct battle_interface *battle;
void battle_defaults(void);
-#endif /* _BATTLE_H_ */
+#endif /* _MAP_BATTLE_H_ */
diff --git a/src/map/battleground.h b/src/map/battleground.h
index 4aeb9f879..ed7347566 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _BATTLEGROUND_H_
-#define _BATTLEGROUND_H_
+#ifndef _MAP_BATTLEGROUND_H_
+#define _MAP_BATTLEGROUND_H_
#include "../common/mmo.h" // struct party
#include "clif.h"
@@ -112,4 +112,4 @@ struct battleground_interface *bg;
void battleground_defaults(void);
-#endif /* _BATTLEGROUND_H_ */
+#endif /* _MAP_BATTLEGROUND_H_ */
diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h
index b0db40661..5141a1013 100644
--- a/src/map/buyingstore.h
+++ b/src/map/buyingstore.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _BUYINGSTORE_H_
-#define _BUYINGSTORE_H_
+#ifndef _MAP_BUYINGSTORE_H_
+#define _MAP_BUYINGSTORE_H_
/**
* Declarations
@@ -70,4 +70,4 @@ struct buyingstore_interface *buyingstore;
void buyingstore_defaults (void);
-#endif // _BUYINGSTORE_H_
+#endif // _MAP_BUYINGSTORE_H_
diff --git a/src/map/chat.h b/src/map/chat.h
index fcbadf008..71e5a11ec 100644
--- a/src/map/chat.h
+++ b/src/map/chat.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _CHAT_H_
-#define _CHAT_H_
+#ifndef _MAP_CHAT_H_
+#define _MAP_CHAT_H_
#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE
@@ -55,4 +55,4 @@ struct chat_interface *chat;
void chat_defaults(void);
-#endif /* _CHAT_H_ */
+#endif /* _MAP_CHAT_H_ */
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 163fdf670..59e45a2ea 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _CHRIF_H_
-#define _CHRIF_H_
+#ifndef _MAP_CHRIF_H_
+#define _MAP_CHRIF_H_
#include "../common/cbasetypes.h"
#include <time.h>
@@ -148,4 +148,4 @@ void chrif_defaults(void);
// There's no need for another function when a simple macro can do exactly the same effect
#define chrif_char_offline(x) chrif->char_offline_nsd((x)->status.account_id,(x)->status.char_id)
-#endif /* _CHRIF_H_ */
+#endif /* _MAP_CHRIF_H_ */
diff --git a/src/map/clif.h b/src/map/clif.h
index 6405bbd3e..1e0319b7b 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _CLIF_H_
-#define _CLIF_H_
+#ifndef _MAP_CLIF_H_
+#define _MAP_CLIF_H_
#include "../common/cbasetypes.h"
#include "../common/db.h"
@@ -1275,4 +1275,4 @@ struct clif_interface *clif;
void clif_defaults(void);
-#endif /* _CLIF_H_ */
+#endif /* _MAP_CLIF_H_ */
diff --git a/src/map/date.h b/src/map/date.h
index cc19d88d1..02238d7ea 100644
--- a/src/map/date.h
+++ b/src/map/date.h
@@ -1,8 +1,8 @@
// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#ifndef _DATE_H_
-#define _DATE_H_
+#ifndef _MAP_DATE_H_
+#define _MAP_DATE_H_
int date_get_year(void);
int date_get_month(void);
@@ -15,4 +15,4 @@ int is_day_of_sun(void);
int is_day_of_moon(void);
int is_day_of_star(void);
-#endif /* _DATE_H_ */
+#endif /* _MAP_DATE_H_ */
diff --git a/src/map/duel.h b/src/map/duel.h
index d60c9531a..5405d2eee 100644
--- a/src/map/duel.h
+++ b/src/map/duel.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _DUEL_H_
-#define _DUEL_H_
+#ifndef _MAP_DUEL_H_
+#define _MAP_DUEL_H_
struct duel {
int members_count;
@@ -42,4 +42,4 @@ struct duel_interface *duel;
void duel_defaults(void);
-#endif /* _DUEL_H_ */
+#endif /* _MAP_DUEL_H_ */
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 830a6a577..6d04a41a5 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _ELEMENTAL_H_
-#define _ELEMENTAL_H_
+#ifndef _MAP_ELEMENTAL_H_
+#define _MAP_ELEMENTAL_H_
#include "status.h" // struct status_data, struct status_change
#include "unit.h" // struct unit_data
@@ -120,4 +120,4 @@ struct elemental_interface *elemental;
void elemental_defaults(void);
-#endif /* _ELEMENTAL_H_ */
+#endif /* _MAP_ELEMENTAL_H_ */
diff --git a/src/map/guild.h b/src/map/guild.h
index 7878d75c3..b03bd664d 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _GUILD_H_
-#define _GUILD_H_
+#ifndef _MAP_GUILD_H_
+#define _MAP_GUILD_H_
//#include "../common/mmo.h"
#include "map.h" // NAME_LENGTH
@@ -173,4 +173,4 @@ struct guild_interface *guild;
void guild_defaults(void);
-#endif /* _GUILD_H_ */
+#endif /* _MAP_GUILD_H_ */
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index 117f9da8e..db250f511 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _HOMUNCULUS_H_
-#define _HOMUNCULUS_H_
+#ifndef _MAP_HOMUNCULUS_H_
+#define _MAP_HOMUNCULUS_H_
#include "status.h" // struct status_data, struct status_change
#include "unit.h" // struct unit_data
@@ -146,4 +146,4 @@ struct homunculus_interface *homun;
void homunculus_defaults(void);
-#endif /* _HOMUNCULUS_H_ */
+#endif /* _MAP_HOMUNCULUS_H_ */
diff --git a/src/map/instance.h b/src/map/instance.h
index 764a55b2b..66a7d0d6c 100644
--- a/src/map/instance.h
+++ b/src/map/instance.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _INSTANCE_H_
-#define _INSTANCE_H_
+#ifndef _MAP_INSTANCE_H_
+#define _MAP_INSTANCE_H_
#define INSTANCE_NAME_LENGTH (60+1)
@@ -82,4 +82,4 @@ struct instance_interface *instance;
void instance_defaults(void);
-#endif
+#endif /* _MAP_INSTANCE_H_ */
diff --git a/src/map/intif.h b/src/map/intif.h
index f0bb5c16e..290dcfcdc 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _INTIF_H_
-#define _INFIF_H_
+#ifndef _MAP_INTIF_H_
+#define _MAP_INTIF_H_
/**
@@ -183,4 +183,4 @@ struct intif_interface *intif;
void intif_defaults(void);
-#endif /* _INTIF_H_ */
+#endif /* _MAP_INTIF_H_ */
diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h
index 7d6a19eba..c15a5d46a 100644
--- a/src/map/irc-bot.h
+++ b/src/map/irc-bot.h
@@ -3,8 +3,8 @@
// Base Author: shennetsind @ http://hercules.ws
-#ifndef _IRC_BOT_H_
-#define _IRC_BOT_H_
+#ifndef _MAP_IRC_BOT_H_
+#define _MAP_IRC_BOT_H_
#define IRC_NICK_LENGTH 40
#define IRC_IDENT_LENGTH 40
@@ -61,4 +61,4 @@ struct irc_bot_interface *ircbot;
void ircbot_defaults(void);
-#endif /* _IRC_BOT_H_ */
+#endif /* _MAP_IRC_BOT_H_ */
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index b3ff606df..74ced13e0 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _ITEMDB_H_
-#define _ITEMDB_H_
+#ifndef _MAP_ITEMDB_H_
+#define _MAP_ITEMDB_H_
#include "../common/db.h"
#include "../common/mmo.h" // ITEM_NAME_LENGTH
@@ -582,4 +582,4 @@ struct itemdb_interface *itemdb;
void itemdb_defaults(void);
-#endif /* _ITEMDB_H_ */
+#endif /* _MAP_ITEMDB_H_ */
diff --git a/src/map/log.h b/src/map/log.h
index 9864a54d7..b2cb92c20 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _LOG_H_
-#define _LOG_H_
+#ifndef _MAP_LOG_H_
+#define _MAP_LOG_H_
#include "../common/cbasetypes.h"
#include "../common/sql.h"
@@ -134,4 +134,4 @@ struct log_interface *logs;
void log_defaults(void);
-#endif /* _LOG_H_ */
+#endif /* _MAP_LOG_H_ */
diff --git a/src/map/mail.h b/src/map/mail.h
index b2b9048cb..8df537ff3 100644
--- a/src/map/mail.h
+++ b/src/map/mail.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _MAIL_H_
-#define _MAIL_H_
+#ifndef _MAP_MAIL_H_
+#define _MAP_MAIL_H_
#include "../common/mmo.h"
@@ -23,4 +23,4 @@ struct mail_interface *mail;
void mail_defaults(void);
-#endif /* _MAIL_H_ */
+#endif /* _MAP_MAIL_H_ */
diff --git a/src/map/map.c b/src/map/map.c
index 33721b028..2be61587f 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -5447,6 +5447,8 @@ int do_init(int argc, char *argv[])
map_load_defaults();
+ HPM_map_do_init();
+ HPM->DataCheck = HPM_map_DataCheck;
HPM->load_sub = HPM_map_plugin_load_sub;
HPM->symbol_defaults_sub = map_hp_symbols;
HPM->grabHPDataSub = HPM_map_grabHPData;
diff --git a/src/map/map.h b/src/map/map.h
index 130b181da..8faf6388e 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _MAP_H_
-#define _MAP_H_
+#ifndef _MAP_MAP_H_
+#define _MAP_MAP_H_
#include "../common/cbasetypes.h"
#include "../common/core.h" // CORE_ST_LAST
@@ -1066,4 +1066,4 @@ struct map_interface *map;
void map_defaults(void);
-#endif /* _MAP_H_ */
+#endif /* _MAP_MAP_H_ */
diff --git a/src/map/mapreg.h b/src/map/mapreg.h
index 157e634cc..c92b6f602 100644
--- a/src/map/mapreg.h
+++ b/src/map/mapreg.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _MAPREG_H_
-#define _MAPREG_H_
+#ifndef _MAP_MAPREG_H_
+#define _MAP_MAPREG_H_
#include "../common/cbasetypes.h"
#include "../common/db.h"
@@ -51,4 +51,4 @@ struct mapreg_interface *mapreg;
void mapreg_defaults(void);
-#endif /* _MAPREG_H_ */
+#endif /* _MAP_MAPREG_H_ */
diff --git a/src/map/mercenary.h b/src/map/mercenary.h
index 3f2214b65..dd9266b2e 100644
--- a/src/map/mercenary.h
+++ b/src/map/mercenary.h
@@ -1,8 +1,8 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _MERCENARY_H_
-#define _MERCENARY_H_
+#ifndef _MAP_MERCENARY_H_
+#define _MAP_MERCENARY_H_
#include "status.h" // struct status_data, struct status_change
#include "unit.h" // struct unit_data
@@ -98,4 +98,4 @@ struct mercenary_interface *mercenary;
void mercenary_defaults(void);
-#endif /* _MERCENARY_H_ */
+#endif /* _MAP_MERCENARY_H_ */
diff --git a/src/map/mob.h b/src/map/mob.h
index 9321cb4fd..80175b1db 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _MOB_H_
-#define _MOB_H_
+#ifndef _MAP_MOB_H_
+#define _MAP_MOB_H_
#include "../common/mmo.h" // struct item
#include "guild.h" // struct guardian_data
@@ -364,4 +364,4 @@ struct mob_interface *mob;
void mob_defaults(void);
-#endif /* _MOB_H_ */
+#endif /* _MAP_MOB_H_ */
diff --git a/src/map/npc.h b/src/map/npc.h
index 266d174fb..719974ac4 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _NPC_H_
-#define _NPC_H_
+#ifndef _MAP_NPC_H_
+#define _MAP_NPC_H_
#include "map.h" // struct block_list
#include "status.h" // struct status_change
@@ -346,4 +346,4 @@ struct pcre_interface *libpcre;
void npc_chat_defaults(void);
#endif
-#endif /* _NPC_H_ */
+#endif /* _MAP_NPC_H_ */
diff --git a/src/map/packets.h b/src/map/packets.h
index cea916f6d..4cf6f6d6a 100644
--- a/src/map/packets.h
+++ b/src/map/packets.h
@@ -3,8 +3,8 @@
//Included directly by clif.h in packet_loaddb()
-#ifndef _PACKETS_H_
-#define _PACKETS_H_
+#ifndef _MAP_PACKETS_H_
+#define _MAP_PACKETS_H_
#ifndef packet
#define packet(a,b,...)
@@ -2693,4 +2693,4 @@ packet(0x020d,-1);
packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3);
#endif
-#endif /* _PACKETS_H_ */
+#endif /* _MAP_PACKETS_H_ */
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 1156f4465..4a599463a 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -3,8 +3,8 @@
/* Hercules Renewal: Phase Two http://hercules.ws/board/topic/383-hercules-renewal-phase-two/ */
-#ifndef _PACKETS_STRUCT_H_
-#define _PACKETS_STRUCT_H_
+#ifndef _MAP_PACKETS_STRUCT_H_
+#define _MAP_PACKETS_STRUCT_H_
#include "../common/mmo.h"
@@ -945,4 +945,4 @@ struct packet_npc_market_open {
#pragma pack(pop)
#endif // not NetBSD < 6 / Solaris
-#endif /* _PACKETS_STRUCT_H_ */
+#endif /* _MAP_PACKETS_STRUCT_H_ */
diff --git a/src/map/party.h b/src/map/party.h
index 051c98af2..05b5309e6 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _PARTY_H_
-#define _PARTY_H_
+#ifndef _MAP_PARTY_H_
+#define _MAP_PARTY_H_
#include "../common/mmo.h" // struct party
#include "../config/core.h"
@@ -141,4 +141,4 @@ struct party_interface *party;
void party_defaults(void);
-#endif /* _PARTY_H_ */
+#endif /* _MAP_PARTY_H_ */
diff --git a/src/map/path.h b/src/map/path.h
index a889a6409..0b67a0120 100644
--- a/src/map/path.h
+++ b/src/map/path.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _PATH_H_
-#define _PATH_H_
+#ifndef _MAP_PATH_H_
+#define _MAP_PATH_H_
#include "map.h" // enum cell_chk
@@ -46,4 +46,4 @@ struct path_interface *path;
void path_defaults(void);
-#endif /* _PATH_H_ */
+#endif /* _MAP_PATH_H_ */
diff --git a/src/map/pc.h b/src/map/pc.h
index 487266646..03b3ddca0 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -1,8 +1,9 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _PC_H_
-#define _PC_H_
+
+#ifndef _MAP_PC_H_
+#define _MAP_PC_H_
#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus
#include "../common/ers.h"
@@ -1044,4 +1045,4 @@ struct pc_interface *pc;
void pc_defaults(void);
-#endif /* _PC_H_ */
+#endif /* _MAP_PC_H_ */
diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
index 3396512ea..5c03f999f 100644
--- a/src/map/pc_groups.h
+++ b/src/map/pc_groups.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _PC_GROUPS_H_
-#define _PC_GROUPS_H_
+#ifndef _MAP_PC_GROUPS_H_
+#define _MAP_PC_GROUPS_H_
/// PC permissions
enum e_pc_permission {
@@ -92,4 +92,4 @@ struct pc_groups_interface *pcg;
void pc_groups_defaults(void);
-#endif // _PC_GROUPS_H_
+#endif /* _MAP_PC_GROUPS_H_ */
diff --git a/src/map/pet.h b/src/map/pet.h
index f1a219700..537a50c4b 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _PET_H_
-#define _PET_H_
+#ifndef _MAP_PET_H_
+#define _MAP_PET_H_
#define MAX_PET_DB 300
#define MAX_PETLOOT_SIZE 30
@@ -152,4 +152,4 @@ struct pet_interface *pet;
void pet_defaults(void);
-#endif /* _PET_H_ */
+#endif /* _MAP_PET_H_ */
diff --git a/src/map/quest.h b/src/map/quest.h
index 28815a6c3..e01e35619 100644
--- a/src/map/quest.h
+++ b/src/map/quest.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _QUEST_H_
-#define _QUEST_H_
+#ifndef _MAP_QUEST_H_
+#define _MAP_QUEST_H_
#define MAX_QUEST_DB (60355+1) // Highest quest ID + 1
@@ -48,4 +48,4 @@ struct quest_interface *quest;
void quest_defaults(void);
-#endif
+#endif /* _MAP_QUEST_H_ */
diff --git a/src/map/script.h b/src/map/script.h
index 97db2a775..b7e9e5741 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _SCRIPT_H_
-#define _SCRIPT_H_
+#ifndef _MAP_SCRIPT_H_
+#define _MAP_SCRIPT_H_
#include "../common/strlib.h" //StringBuf
#include "../common/cbasetypes.h"
@@ -700,4 +700,4 @@ struct script_interface *script;
void script_defaults(void);
-#endif /* _SCRIPT_H_ */
+#endif /* _MAP_SCRIPT_H_ */
diff --git a/src/map/searchstore.h b/src/map/searchstore.h
index d7a327181..827e39053 100644
--- a/src/map/searchstore.h
+++ b/src/map/searchstore.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _SEARCHSTORE_H_
-#define _SEARCHSTORE_H_
+#ifndef _MAP_SEARCHSTORE_H_
+#define _MAP_SEARCHSTORE_H_
/**
* Defines
@@ -93,4 +93,4 @@ struct searchstore_interface *searchstore;
void searchstore_defaults (void);
-#endif // _SEARCHSTORE_H_
+#endif /* _MAP_SEARCHSTORE_H_ */
diff --git a/src/map/skill.h b/src/map/skill.h
index 28cb548d2..78829f17e 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _SKILL_H_
-#define _SKILL_H_
+#ifndef _MAP_SKILL_H_
+#define _MAP_SKILL_H_
#include "../common/mmo.h" // MAX_SKILL, struct square
#include "../common/db.h"
@@ -2015,4 +2015,4 @@ struct skill_interface *skill;
void skill_defaults(void);
-#endif /* _SKILL_H_ */
+#endif /* _MAP_SKILL_H_ */
diff --git a/src/map/status.h b/src/map/status.h
index f319b1506..d3148b4e0 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _STATUS_H_
-#define _STATUS_H_
+#ifndef _MAP_STATUS_H_
+#define _MAP_STATUS_H_
#include "../common/mmo.h"
@@ -2012,4 +2012,4 @@ struct status_interface *status;
void status_defaults(void);
-#endif /* _STATUS_H_ */
+#endif /* _MAP_STATUS_H_ */
diff --git a/src/map/storage.h b/src/map/storage.h
index 8a10c9f3b..8f9f904f6 100644
--- a/src/map/storage.h
+++ b/src/map/storage.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _STORAGE_H_
-#define _STORAGE_H_
+#ifndef _MAP_STORAGE_H_
+#define _MAP_STORAGE_H_
struct storage_data;
struct guild_storage;
@@ -59,4 +59,4 @@ struct guild_storage_interface *gstorage;
void storage_defaults(void);
void gstorage_defaults(void);
-#endif /* _STORAGE_H_ */
+#endif /* _MAP_STORAGE_H_ */
diff --git a/src/map/trade.h b/src/map/trade.h
index d0b900504..f2c0d4622 100644
--- a/src/map/trade.h
+++ b/src/map/trade.h
@@ -2,10 +2,11 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _TRADE_H_
-#define _TRADE_H_
+#ifndef _MAP_TRADE_H_
+#define _MAP_TRADE_H_
//Max distance from traders to enable a trade to take place.
+//TODO: battle_config candidate?
#define TRADE_DISTANCE 2
struct map_session_data;
@@ -26,4 +27,4 @@ struct trade_interface *trade;
void trade_defaults(void);
-#endif /* _TRADE_H_ */
+#endif /* _MAP_TRADE_H_ */
diff --git a/src/map/unit.h b/src/map/unit.h
index a2d743875..33fa4e052 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -1,8 +1,9 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
-#ifndef _UNIT_H_
-#define _UNIT_H_
+#ifndef _MAP_UNIT_H_
+#define _MAP_UNIT_H_
//#include "map.h"
struct block_list;
@@ -125,4 +126,4 @@ struct unit_interface *unit;
void unit_defaults(void);
-#endif /* _UNIT_H_ */
+#endif /* _MAP_UNIT_H_ */
diff --git a/src/map/vending.h b/src/map/vending.h
index b760bf064..b2ba22955 100644
--- a/src/map/vending.h
+++ b/src/map/vending.h
@@ -2,8 +2,8 @@
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-#ifndef _VENDING_H_
-#define _VENDING_H_
+#ifndef _MAP_VENDING_H_
+#define _MAP_VENDING_H_
#include "../common/cbasetypes.h"
#include "../common/db.h"
@@ -35,4 +35,4 @@ struct vending_interface *vending;
void vending_defaults(void);
-#endif /* _VENDING_H_ */
+#endif /* _MAP_VENDING_H_ */