diff options
author | Dastgir <dastgirpojee@rocketmail.com> | 2015-01-15 12:11:08 +0530 |
---|---|---|
committer | Dastgir <dastgirpojee@rocketmail.com> | 2015-01-15 12:11:08 +0530 |
commit | 06166cac023cefa193926de5a47dd7bc11f298b3 (patch) | |
tree | 3e235122b16652e9262736e82d0f0804680aae22 /src/map | |
parent | 9fbeb05aa054b5ed9641460d2639f30812edd957 (diff) | |
parent | 3c032b6766ded92ef032862ff3b812cad0eacefd (diff) | |
download | hercules-06166cac023cefa193926de5a47dd7bc11f298b3.tar.gz hercules-06166cac023cefa193926de5a47dd7bc11f298b3.tar.bz2 hercules-06166cac023cefa193926de5a47dd7bc11f298b3.tar.xz hercules-06166cac023cefa193926de5a47dd7bc11f298b3.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map')
39 files changed, 96 insertions, 14 deletions
diff --git a/src/map/HPMmap.h b/src/map/HPMmap.h index fa2f625c0..0c727d017 100644 --- a/src/map/HPMmap.h +++ b/src/map/HPMmap.h @@ -4,6 +4,10 @@ #ifndef MAP_HPMMAP_H #define MAP_HPMMAP_H +#ifndef HERCULES_CORE +#error You should never include HPMmap.h from a plugin. +#endif + #include "../common/cbasetypes.h" #include "../map/atcommand.h" #include "../common/HPM.h" diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 215ecbc70..56dd5784c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -626,9 +626,9 @@ ACMD(who) { if (map_id < 0) { if (count == 0) - StrBuf->Printf(&buf, msg_txt(28)); // No player found. + StrBuf->AppendStr(&buf, msg_txt(28)); // No player found. else if (count == 1) - StrBuf->Printf(&buf, msg_txt(29)); // 1 player found. + StrBuf->AppendStr(&buf, msg_txt(29)); // 1 player found. else StrBuf->Printf(&buf, msg_txt(30), count); // %d players found. } else { @@ -5979,7 +5979,7 @@ ACMD(mobsearch) clif->message(fd, atcmd_output); return false; } - if(mob_id == atoi(mob_name) && mob->db(mob_id)->jname) + if (mob_id == atoi(mob_name)) strcpy(mob_name,mob->db(mob_id)->jname); // --ja-- //strcpy(mob_name,mob_db(mob_id)->name); // --en-- diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 356487bd1..8d0399f25 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -116,7 +116,9 @@ struct atcommand_interface { struct atcommand_interface *atcommand; +#ifdef HERCULES_CORE void atcommand_defaults(void); +#endif // HERCULES_CORE /* 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) diff --git a/src/map/battle.h b/src/map/battle.h index ea2538c30..ddd98ec69 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -487,7 +487,9 @@ struct Battle_Config { int feature_roulette; }; +#ifdef HERCULES_CORE extern struct Battle_Config battle_config; +#endif // HERCULES_CORE /* criteria for battle_config.idletime_critera */ enum e_battle_config_idletime { @@ -620,5 +622,8 @@ struct battle_interface { struct battle_interface *battle; +#ifdef HERCULES_CORE void battle_defaults(void); +#endif // HERCULES_CORE + #endif /* MAP_BATTLE_H */ diff --git a/src/map/battleground.h b/src/map/battleground.h index c1d3be054..9878d6be0 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -120,6 +120,8 @@ struct battleground_interface { struct battleground_interface *bg; +#ifdef HERCULES_CORE void battleground_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_BATTLEGROUND_H */ diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h index c981cc444..7b8e369d2 100644 --- a/src/map/buyingstore.h +++ b/src/map/buyingstore.h @@ -73,6 +73,8 @@ struct buyingstore_interface { struct buyingstore_interface *buyingstore; +#ifdef HERCULES_CORE void buyingstore_defaults (void); +#endif // HERCULES_CORE #endif // MAP_BUYINGSTORE_H diff --git a/src/map/chat.h b/src/map/chat.h index 6fca018f4..ced216b41 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -57,6 +57,8 @@ struct chat_interface { struct chat_interface *chat; +#ifdef HERCULES_CORE void chat_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_CHAT_H */ diff --git a/src/map/chrif.h b/src/map/chrif.h index 2ef4d0eb5..271fc076d 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -40,6 +40,8 @@ struct auth_node { enum sd_state state; //To track whether player was login in/out or changing maps. }; +#define chrif_char_offline(x) chrif->char_offline_nsd((x)->status.account_id,(x)->status.char_id) + /*===================================== * Interface : chrif.h * Generated by HerculesInterfaceMaker @@ -150,8 +152,8 @@ struct chrif_interface { struct chrif_interface *chrif; +#ifdef HERCULES_CORE 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 // HERCULES_CORE #endif /* MAP_CHRIF_H */ diff --git a/src/map/clif.h b/src/map/clif.h index 4c90a3a28..3144f1586 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1337,6 +1337,8 @@ struct clif_interface { struct clif_interface *clif; +#ifdef HERCULES_CORE void clif_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_CLIF_H */ diff --git a/src/map/date.h b/src/map/date.h index c3f353f64..a57d8132c 100644 --- a/src/map/date.h +++ b/src/map/date.h @@ -6,6 +6,8 @@ #include "../common/cbasetypes.h" +#ifdef HERCULES_CORE +// TODO: Interface int date_get_year(void); int date_get_month(void); int date_get_day(void); @@ -16,5 +18,6 @@ int date_get_sec(void); bool is_day_of_sun(void); bool is_day_of_moon(void); bool is_day_of_star(void); +#endif // HERCULES_CORE #endif /* MAP_DATE_H */ diff --git a/src/map/duel.h b/src/map/duel.h index 5466f3b43..fa12a4032 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -44,6 +44,8 @@ struct duel_interface { struct duel_interface *duel; +#ifdef HERCULES_CORE void duel_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_DUEL_H */ diff --git a/src/map/elemental.h b/src/map/elemental.h index ca13c30b8..8015f84c0 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -119,6 +119,8 @@ struct elemental_interface { struct elemental_interface *elemental; +#ifdef HERCULES_CORE void elemental_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_ELEMENTAL_H */ diff --git a/src/map/guild.h b/src/map/guild.h index eb6de7070..a75b8a7a5 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -165,6 +165,8 @@ struct guild_interface { struct guild_interface *guild; +#ifdef HERCULES_CORE void guild_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_GUILD_H */ diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 5b1fd2031..18f8728d3 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -157,6 +157,8 @@ struct homunculus_interface { struct homunculus_interface *homun; +#ifdef HERCULES_CORE void homunculus_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_HOMUNCULUS_H */ diff --git a/src/map/instance.h b/src/map/instance.h index 4848c9c59..80bd1f012 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -86,6 +86,8 @@ struct instance_interface { struct instance_interface *instance; +#ifdef HERCULES_CORE void instance_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_INSTANCE_H */ diff --git a/src/map/intif.h b/src/map/intif.h index fe47d6537..52aa32259 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -184,6 +184,8 @@ struct intif_interface { struct intif_interface *intif; +#ifdef HERCULES_CORE void intif_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_INTIF_H */ diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h index 0c26c3cd8..23c2fabc8 100644 --- a/src/map/irc-bot.h +++ b/src/map/irc-bot.h @@ -61,6 +61,8 @@ struct irc_bot_interface { struct irc_bot_interface *ircbot; +#ifdef HERCULES_CORE void ircbot_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_IRC_BOT_H */ diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 902e6e5e9..1d811e3cb 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -621,6 +621,8 @@ struct itemdb_interface { struct itemdb_interface *itemdb; +#ifdef HERCULES_CORE void itemdb_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_ITEMDB_H */ diff --git a/src/map/log.h b/src/map/log.h index fb61b6e66..b4b8b84f4 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -131,6 +131,8 @@ struct log_interface { struct log_interface *logs; +#ifdef HERCULES_CORE void log_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_LOG_H */ diff --git a/src/map/mail.h b/src/map/mail.h index 64b0f9779..db49ca39e 100644 --- a/src/map/mail.h +++ b/src/map/mail.h @@ -25,6 +25,8 @@ struct mail_interface { struct mail_interface *mail; +#ifdef HERCULES_CORE void mail_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_MAIL_H */ diff --git a/src/map/map.h b/src/map/map.h index 447437cf4..f5f85f334 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1078,6 +1078,8 @@ struct map_interface { struct map_interface *map; +#ifdef HERCULES_CORE void map_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_MAP_H */ diff --git a/src/map/mapreg.h b/src/map/mapreg.h index 59d226cda..9c9a1acee 100644 --- a/src/map/mapreg.h +++ b/src/map/mapreg.h @@ -48,6 +48,8 @@ struct mapreg_interface { struct mapreg_interface *mapreg; +#ifdef HERCULES_CORE void mapreg_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_MAPREG_H */ diff --git a/src/map/mercenary.h b/src/map/mercenary.h index 68f60b08b..fbf3603f6 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -97,6 +97,8 @@ struct mercenary_interface { struct mercenary_interface *mercenary; +#ifdef HERCULES_CORE void mercenary_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_MERCENARY_H */ diff --git a/src/map/mob.h b/src/map/mob.h index 9aac2c664..02ae1630a 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -382,6 +382,8 @@ struct mob_interface { struct mob_interface *mob; +#ifdef HERCULES_CORE void mob_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_MOB_H */ diff --git a/src/map/npc.h b/src/map/npc.h index b0014e323..68d683847 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -281,7 +281,9 @@ struct npc_interface { struct npc_interface *npc; +#ifdef HERCULES_CORE void npc_defaults(void); +#endif // HERCULES_CORE /* comes from npc_chat.c */ @@ -347,7 +349,9 @@ struct pcre_interface *libpcre; /** * Also defaults libpcre **/ +#ifdef HERCULES_CORE void npc_chat_defaults(void); -#endif +#endif // HERCULES_CORE +#endif // PCRE_SUPPORT #endif /* MAP_NPC_H */ diff --git a/src/map/party.h b/src/map/party.h index f6cd448a6..a541d03cb 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -141,6 +141,8 @@ struct party_interface { struct party_interface *party; +#ifdef HERCULES_CORE void party_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_PARTY_H */ diff --git a/src/map/path.h b/src/map/path.h index 4b71f2189..eb42df6d0 100644 --- a/src/map/path.h +++ b/src/map/path.h @@ -55,6 +55,8 @@ struct path_interface { struct path_interface *path; +#ifdef HERCULES_CORE void path_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_PATH_H */ diff --git a/src/map/pc.h b/src/map/pc.h index 1f5e26270..7e2fa8558 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1024,6 +1024,8 @@ struct pc_interface { struct pc_interface *pc; +#ifdef HERCULES_CORE void pc_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_PC_H */ diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 48ff782dd..8dd95a177 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -98,6 +98,8 @@ struct pc_groups_interface { struct pc_groups_interface *pcg; +#ifdef HERCULES_CORE void pc_groups_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_PC_GROUPS_H */ diff --git a/src/map/pet.h b/src/map/pet.h index cffcf7dd0..0b51bcb16 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -155,6 +155,8 @@ struct pet_interface { struct pet_interface *pet; +#ifdef HERCULES_CORE void pet_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_PET_H */ diff --git a/src/map/quest.h b/src/map/quest.h index 9d617e369..f988d0c61 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -50,6 +50,8 @@ struct quest_interface { struct quest_interface *quest; +#ifdef HERCULES_CORE void quest_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_QUEST_H */ diff --git a/src/map/script.h b/src/map/script.h index 548c0f261..ad63c1ad7 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -716,6 +716,8 @@ struct script_interface { struct script_interface *script; +#ifdef HERCULES_CORE void script_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_SCRIPT_H */ diff --git a/src/map/searchstore.h b/src/map/searchstore.h index d8abde615..6664eddfa 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -97,6 +97,8 @@ struct searchstore_interface { struct searchstore_interface *searchstore; -void searchstore_defaults (void); +#ifdef HERCULES_CORE +void searchstore_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_SEARCHSTORE_H */ diff --git a/src/map/skill.c b/src/map/skill.c index db675d7f4..53be5541c 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3152,7 +3152,7 @@ int skill_area_sub_count(struct block_list *src, struct block_list *target, uint * *------------------------------------------*/ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { - struct block_list *src = map->id2bl(id),*target; + struct block_list *src = map->id2bl(id),*target = NULL; struct unit_data *ud = unit->bl2ud(src); struct skill_timerskill *skl; int range; @@ -3382,7 +3382,7 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { skill->get_type(skl->skill_id),src,src,skl->skill_id,skl->skill_lv,tick,skl->flag,BCT_ENEMY); break; default: - skill->timerskill_notarget_unknown(tid, tick, src, target, ud, skl); + skill->timerskill_notarget_unknown(tid, tick, src, ud, skl); break; } } @@ -3402,7 +3402,7 @@ void skill_timerskill_target_unknown(int tid, int64 tick, struct block_list *src skill->attack(skl->type, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag); } -void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl) +void skill_timerskill_notarget_unknown(int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl) { } @@ -14552,9 +14552,9 @@ bool skill_get_requirement_off_unknown(struct status_change *sc, uint16 *skill_i return false; } -int skill_get_requirement_item_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i) +bool skill_get_requirement_item_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i) { - return -1; + return false; } void skill_get_requirement_unknown(struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req) diff --git a/src/map/skill.h b/src/map/skill.h index 6cb43405f..31a268971 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -2055,7 +2055,7 @@ struct skill_interface { void (*attack_post_unknown) (int *attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); bool (*timerskill_dead_unknown) (struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl); void (*timerskill_target_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl); - void (*timerskill_notarget_unknown) (int tid, int64 tick, struct block_list *src, struct block_list *target, struct unit_data *ud, struct skill_timerskill *skl); + void (*timerskill_notarget_unknown) (int tid, int64 tick, struct block_list *src, struct unit_data *ud, struct skill_timerskill *skl); bool (*cleartimerskill_exception) (int skill_id); bool (*castend_id_unknown) (struct unit_data *ud, struct block_list *src, struct block_list *target); bool (*castend_nodamage_id_dead_unknown) (struct block_list *src, struct block_list *bl, uint16 *skill_id, uint16 *skill_lv, int64 *tick, int *flag); @@ -2073,12 +2073,14 @@ struct skill_interface { int (*check_condition_castbegin_unknown) (struct status_change *sc, uint16 *skill_id); void (*check_condition_castend_unknown) (struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv); bool (*get_requirement_off_unknown) (struct status_change *sc, uint16 *skill_id); - int (*get_requirement_item_unknown) (struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i); + bool (*get_requirement_item_unknown) (struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, uint16 *idx, int *i); void (*get_requirement_unknown) (struct status_change *sc, struct map_session_data* sd, uint16 *skill_id, uint16 *skill_lv, struct skill_condition *req); }; struct skill_interface *skill; +#ifdef HERCULES_CORE void skill_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_SKILL_H */ diff --git a/src/map/status.h b/src/map/status.h index 63f9854d5..f281a4d08 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2122,6 +2122,8 @@ struct status_interface { struct status_interface *status; +#ifdef HERCULES_CORE void status_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_STATUS_H */ diff --git a/src/map/storage.h b/src/map/storage.h index fcf9a52e4..6393e124a 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -56,7 +56,9 @@ struct guild_storage_interface { struct guild_storage_interface *gstorage; +#ifdef HERCULES_CORE void storage_defaults(void); void gstorage_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_STORAGE_H */ diff --git a/src/map/trade.h b/src/map/trade.h index f91ccd4a2..85e73025c 100644 --- a/src/map/trade.h +++ b/src/map/trade.h @@ -25,6 +25,8 @@ struct trade_interface { struct trade_interface *trade; +#ifdef HERCULES_CORE void trade_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_TRADE_H */ diff --git a/src/map/vending.h b/src/map/vending.h index 63cb632a9..00d3eefff 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -34,6 +34,8 @@ struct vending_interface { struct vending_interface *vending; +#ifdef HERCULES_CORE void vending_defaults(void); +#endif // HERCULES_CORE #endif /* MAP_VENDING_H */ |