From 428c65b5c8d000d1cf3b3540de5bd91124c76113 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 17 Jan 2015 00:40:26 +0300 Subject: map: change exp table validation for only used classes. --- src/map/init.c | 1 + src/map/pc.c | 16 ++++++++++++++++ src/map/pc.h | 2 ++ 3 files changed, 19 insertions(+) (limited to 'src') diff --git a/src/map/init.c b/src/map/init.c index 22bb403..90ecffb 100644 --- a/src/map/init.c +++ b/src/map/init.c @@ -110,6 +110,7 @@ HPExport void plugin_init (void) addHookPre("pc->unequipitem_pos", epc_unequipitem_pos); addHookPre("pc->can_attack", epc_can_attack); addHookPre("pc->takeitem", epc_takeitem); + addHookPre("pc->validate_levels", epc_validate_levels); addHookPre("npc->parse_unknown_mapflag", enpc_parse_unknown_mapflag); addHookPre("npc->buysellsel", enpc_buysellsel); addHookPre("npc->db_checkid", enpc_db_checkid); diff --git a/src/map/pc.c b/src/map/pc.c index fba2441..612393f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -165,3 +165,19 @@ int epc_takeitem(struct map_session_data *sd __attribute__ ((unused)), } return 1; } + +void epc_validate_levels(void) +{ + int i; + for (i = 0; i < 7; i++) { + if (!pc->db_checkid(i)) continue; + if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER) + continue; //Classes that do not need exp tables. + int j = pc->class2idx(i); + if (!pc->max_level[j][0]) + ShowWarning("Class %d does not has a base exp table.\n", i); + if (!pc->max_level[j][1]) + ShowWarning("Class %d does not has a job exp table.\n", i); + } + hookStop(); +} diff --git a/src/map/pc.h b/src/map/pc.h index cfc37a0..429a74d 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -21,4 +21,6 @@ bool epc_can_attack (struct map_session_data *sd, int *target_id); int epc_takeitem(struct map_session_data *sd, struct flooritem_data *fitem); +void epc_validate_levels(void); + #endif // EVOL_MAP_PC -- cgit v1.2.3-70-g09d2