summaryrefslogtreecommitdiff
path: root/src/map/battleground.c
diff options
context:
space:
mode:
authorj-tkay <joseph.tk.ea@gmail.com>2013-06-28 20:11:19 +0800
committerj-tkay <joseph.tk.ea@gmail.com>2013-06-28 20:11:19 +0800
commit8489dbf3b58d3bff70b27ea42884a14d5229430a (patch)
tree89e0f9be6b3bc7c3ebc135fc311d9f6d6ebbfeec /src/map/battleground.c
parentde7919f0f59f47473e6de709b5d5287a4a55e18d (diff)
parent2154c0fa9cee582a36f9a8d7923a646a6d47adf0 (diff)
downloadhercules-8489dbf3b58d3bff70b27ea42884a14d5229430a.tar.gz
hercules-8489dbf3b58d3bff70b27ea42884a14d5229430a.tar.bz2
hercules-8489dbf3b58d3bff70b27ea42884a14d5229430a.tar.xz
hercules-8489dbf3b58d3bff70b27ea42884a14d5229430a.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/battleground.c')
-rw-r--r--src/map/battleground.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 64bc25269..88cc323bf 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -420,9 +420,20 @@ int bg_id2pos ( int queue_id, int account_id ) {
}
return 0;
}
+void bg_queue_ready_ack (struct bg_arena *arena, struct map_session_data *sd, bool response) {
+ if( arena->begin_timer == INVALID_TIMER || !sd->bg_queue.arena || sd->bg_queue.arena != arena ) {
+ bg->queue_pc_cleanup(sd);
+ return;
+ }
+ if( response ) {
+ sd->bg_queue.ready = 1;
+ /* check if all are ready then cancell timer, and start game */
+ } else
+ bg->queue_pc_cleanup(sd);
+}
void bg_queue_player_cleanup(struct map_session_data *sd) {
if ( sd->bg_queue.client_has_bg_data ) {
- clif->bgqueue_notice_delete(sd,BGQND_CLOSEWINDOW, sd->bg_queue.arena->id);
+ clif->bgqueue_notice_delete(sd,BGQND_CLOSEWINDOW, sd->bg_queue.arena ? sd->bg_queue.arena->id : 0);
}
script->queue_remove(sd->bg_queue.arena->queue_id,sd->status.account_id);
sd->bg_queue.arena = NULL;
@@ -726,6 +737,7 @@ void battleground_defaults(void) {
bg->begin_timer = bg_begin_timer;
bg->queue_pregame = bg_queue_pregame;
bg->fillup_timer = bg_fillup_timer;
+ bg->queue_ready_ack = bg_queue_ready_ack;
/* */
bg->config_read = bg_config_read;
}