diff options
author | shennetsind <notind@gmail.com> | 2013-06-08 13:15:28 -0700 |
---|---|---|
committer | shennetsind <notind@gmail.com> | 2013-06-08 13:15:28 -0700 |
commit | 13f5061b2640f017028c0d6f9ea0b657631b46c3 (patch) | |
tree | 0304d4af4a803632f2fb9a8aa32455af49882375 /src/map/chat.c | |
parent | 6d042dcbb41cc278f14706e7306412642ea90d3a (diff) | |
parent | d73783f22b2bb881aab74524d153d89a5932a199 (diff) | |
download | hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.tar.gz hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.tar.bz2 hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.tar.xz hercules-13f5061b2640f017028c0d6f9ea0b657631b46c3.zip |
Merge pull request #39 from Earisu/master
Help with renewal phase one and HPM system
Diffstat (limited to 'src/map/chat.c')
-rw-r--r-- | src/map/chat.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/map/chat.c b/src/map/chat.c index a18e87eef..c0452f2c5 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -44,7 +44,7 @@ static struct chat_data* chat_createchat(struct block_list* bl, const char* titl cd->owner = bl; safestrncpy(cd->npc_event, ev, sizeof(cd->npc_event)); - cd->bl.id = map_get_new_object_id(); + cd->bl.id = iMap->get_new_object_id(); cd->bl.m = bl->m; cd->bl.x = bl->x; cd->bl.y = bl->y; @@ -57,7 +57,7 @@ static struct chat_data* chat_createchat(struct block_list* bl, const char* titl cd = NULL; } - map_addiddb(&cd->bl); + iMap->addiddb(&cd->bl); if( bl->type != BL_NPC ) cd->kick_list = idb_alloc(DB_OPT_BASE); @@ -87,7 +87,7 @@ int chat_createpcchat(struct map_session_data* sd, const char* title, const char return 0; //Can't create chatrooms on this map. } - if( map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) ) + if( iMap->getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOCHAT) ) { clif->message (sd->fd, msg_txt(665)); return 0; @@ -117,7 +117,7 @@ int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass) struct chat_data* cd; nullpo_ret(sd); - cd = (struct chat_data*)map_id2bl(chatid); + cd = (struct chat_data*)iMap->id2bl(chatid); if( cd == NULL || cd->bl.type != BL_CHAT || cd->bl.m != sd->bl.m || sd->state.vending || sd->state.buyingstore || sd->chatID || ((cd->owner->type == BL_NPC) ? cd->users+1 : cd->users) >= cd->limit ) { @@ -177,7 +177,7 @@ int chat_leavechat(struct map_session_data* sd, bool kicked) nullpo_retr(1, sd); - cd = (struct chat_data*)map_id2bl(sd->chatID); + cd = (struct chat_data*)iMap->id2bl(sd->chatID); if( cd == NULL ) { pc_setchatid(sd, 0); @@ -207,11 +207,11 @@ int chat_leavechat(struct map_session_data* sd, bool kicked) clif->clearchat(cd, 0); db_destroy(cd->kick_list); - map_deliddb(&cd->bl); - map_delblock(&cd->bl); - map_freeblock(&cd->bl); + iMap->deliddb(&cd->bl); + iMap->delblock(&cd->bl); + iMap->freeblock(&cd->bl); - unit = map_find_skill_unit_oncell(&sd->bl, sd->bl.x, sd->bl.y, AL_WARP, NULL, 0); + unit = iMap->find_skill_unit_oncell(&sd->bl, sd->bl.x, sd->bl.y, AL_WARP, NULL, 0); group = (unit != NULL) ? unit->group : NULL; if (group != NULL) skill->unit_onplace(unit, &sd->bl, group->tick); @@ -226,10 +226,10 @@ int chat_leavechat(struct map_session_data* sd, bool kicked) clif->clearchat(cd, 0); //Adjust Chat location after owner has been changed. - map_delblock( &cd->bl ); + iMap->delblock( &cd->bl ); cd->bl.x=cd->usersd[0]->bl.x; cd->bl.y=cd->usersd[0]->bl.y; - map_addblock( &cd->bl ); + iMap->addblock( &cd->bl ); clif->dispchat(cd,0); } @@ -250,7 +250,7 @@ int chat_changechatowner(struct map_session_data* sd, const char* nextownername) nullpo_retr(1, sd); - cd = (struct chat_data*)map_id2bl(sd->chatID); + cd = (struct chat_data*)iMap->id2bl(sd->chatID); if( cd == NULL || (struct block_list*) sd != cd->owner ) return 1; @@ -271,10 +271,10 @@ int chat_changechatowner(struct map_session_data* sd, const char* nextownername) cd->usersd[0] = tmpsd; // set the new chatroom position - map_delblock( &cd->bl ); + iMap->delblock( &cd->bl ); cd->bl.x = cd->owner->x; cd->bl.y = cd->owner->y; - map_addblock( &cd->bl ); + iMap->addblock( &cd->bl ); // and display again clif->dispchat(cd,0); @@ -291,7 +291,7 @@ int chat_changechatstatus(struct map_session_data* sd, const char* title, const nullpo_retr(1, sd); - cd = (struct chat_data*)map_id2bl(sd->chatID); + cd = (struct chat_data*)iMap->id2bl(sd->chatID); if( cd==NULL || (struct block_list *)sd != cd->owner ) return 1; @@ -316,7 +316,7 @@ int chat_kickchat(struct map_session_data* sd, const char* kickusername) nullpo_retr(1, sd); - cd = (struct chat_data *)map_id2bl(sd->chatID); + cd = (struct chat_data *)iMap->id2bl(sd->chatID); if( cd==NULL || (struct block_list *)sd != cd->owner ) return -1; @@ -366,15 +366,15 @@ int chat_deletenpcchat(struct npc_data* nd) struct chat_data *cd; nullpo_ret(nd); - cd = (struct chat_data*)map_id2bl(nd->chat_id); + cd = (struct chat_data*)iMap->id2bl(nd->chat_id); if( cd == NULL ) return 0; chat_npckickall(cd); clif->clearchat(cd, 0); - map_deliddb(&cd->bl); - map_delblock(&cd->bl); - map_freeblock(&cd->bl); + iMap->deliddb(&cd->bl); + iMap->delblock(&cd->bl); + iMap->freeblock(&cd->bl); nd->chat_id = 0; return 0; |