diff options
author | Haru <haru@dotalux.com> | 2019-08-26 01:38:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 01:38:26 +0200 |
commit | 29e6bbef1b7d4c2434cc6bc8e7a0226227ec6281 (patch) | |
tree | 2a87caab4d2a26e279af63dd02871f6553021449 /src/map/script.c | |
parent | dae5933998758c4fcf8a7dde452d34a3b8fd052c (diff) | |
parent | 0f5da8e9f5ef70c9d2e845c1e69e2b2024094ee9 (diff) | |
download | hercules-29e6bbef1b7d4c2434cc6bc8e7a0226227ec6281.tar.gz hercules-29e6bbef1b7d4c2434cc6bc8e7a0226227ec6281.tar.bz2 hercules-29e6bbef1b7d4c2434cc6bc8e7a0226227ec6281.tar.xz hercules-29e6bbef1b7d4c2434cc6bc8e7a0226227ec6281.zip |
Merge pull request #2522 from MishimaHaruna/remove-inter-roundtrips
Remove some round-trips to the inter-server
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/map/script.c b/src/map/script.c index c3e884bb4..4fc47e039 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11914,12 +11914,12 @@ static BUILDIN(announce) int fontAlign = script_hasdata(st,7) ? script_getnum(st,7) : 0; // default fontAlign int fontY = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontY size_t len = strlen(mes); + send_target target = ALL_CLIENT; + struct block_list *bl = NULL; Assert_retr(false, len < INT_MAX); if( flag&(BC_TARGET_MASK|BC_SOURCE_MASK) ) { // Broadcast source or broadcast region defined - send_target target; - struct block_list *bl = NULL; if (flag&BC_NPC) { // If bc_npc flag is set, use NPC as broadcast source bl = map->id2bl(st->oid); @@ -11937,17 +11937,13 @@ static BUILDIN(announce) case BC_SELF: target = SELF; break; default: target = ALL_CLIENT; break; // BC_ALL } - - if (fontColor) - clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target); - else - clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target); - } else { - if (fontColor) - intif->broadcast2(mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY); - else - intif->broadcast(mes, (int)len+1, flag&BC_COLOR_MASK); } + + if (fontColor) + clif->broadcast2(bl, mes, (int)len+1, (unsigned int)strtoul(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, target); + else + clif->broadcast(bl, mes, (int)len+1, flag&BC_COLOR_MASK, target); + return true; } /*========================================== |