diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-05-14 03:15:51 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-05-14 03:15:51 +0000 |
commit | 7a8dc0434b420af441041e2ec2fe32ee614c4555 (patch) | |
tree | a0f149b4b0565d1f3ee93ccf4c0a5a1fdb8b717c /src/map/map.c | |
parent | 851f1599bd54aad53efa05863a7b5a5441972b54 (diff) | |
download | hercules-7a8dc0434b420af441041e2ec2fe32ee614c4555.tar.gz hercules-7a8dc0434b420af441041e2ec2fe32ee614c4555.tar.bz2 hercules-7a8dc0434b420af441041e2ec2fe32ee614c4555.tar.xz hercules-7a8dc0434b420af441041e2ec2fe32ee614c4555.zip |
* Random accumulated bits and pieces.
- Added checks/warnings to pc_paycash and pc_getcash (follow up to r12264).
- Added missing packet_db.txt and packet length table entries for packet 0x0859 (follow up to r14799).
- Added set of map_id2xx wrappers for map_id2bl for most common map objects, which return NULL when the bl-type is not the expected one (also updated map_id2nd to behave this way).
- Fixed missing ',' in mob_skill_db.txt example (follow up to r14270).
- Updated mapcache with recent maps (up to que_lhz).
- Functions 'msg_txt' and 'job_name' now return a const pointer.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14813 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/map/map.c b/src/map/map.c index 12c805ef3..762cf1446 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1659,8 +1659,30 @@ struct mob_data * map_id2md(int id) struct npc_data * map_id2nd(int id) {// just a id2bl lookup because there's no npc_db - if (id <= 0) return NULL; - return (struct npc_data*)map_id2bl(id); + struct block_list* bl = map_id2bl(id); + + return BL_CAST(BL_NPC, bl); +} + +struct homun_data* map_id2hd(int id) +{ + struct block_list* bl = map_id2bl(id); + + return BL_CAST(BL_HOM, bl); +} + +struct mercenary_data* map_id2mc(int id) +{ + struct block_list* bl = map_id2bl(id); + + return BL_CAST(BL_MER, bl); +} + +struct chat_data* map_id2cd(int id) +{ + struct block_list* bl = map_id2bl(id); + + return BL_CAST(BL_CHAT, bl); } /// Returns the nick of the target charid or NULL if unknown (requests the nick to the char server). |