--- a/rts/Game/WebbarBrowser.h +++ b/rts/Game/WebbarBrowser.h @@ -81,7 +81,7 @@ if (!catalogSent) { catalogSent = true; if (std::getenv("WEBBAR_NETWORK") != nullptr) { static WebbarNetworkResult result; } - MAIN_THREAD_EM_ASM({ if (Module['webbarProtocol']) Module['webbarProtocol'](8, 63 /* restore | shields | cloak | resurrection | native work effects | area resurrection */); }); + MAIN_THREAD_EM_ASM({ if (Module['webbarProtocol']) Module['webbarProtocol'](8, 127 /* restore | shields | cloak | resurrection | native work effects | area resurrection | manual launch */); }); MAIN_THREAD_EM_ASM({ if (Module['webbarIdentity']) Module['webbarIdentity']($0, $1, $2, $3); }, gu->myPlayerNum, gu->myTeam, gu->myAllyTeam, int(gu->spectating)); @@ -185,6 +185,8 @@ }, lastPaused, gs->frameNum); } + // Pinned BAR modules/customcommands.lua; its synced gadget reissues native MANUALFIRE. + constexpr int BAR_MANUAL_LAUNCH = 32102; struct BrowserOrder { uint32_t request, kind, count, target, options; float x, z, radius; @@ -291,11 +293,11 @@ } else if (order.kind == CMD_STOCKPILE || order.kind == 1009) { requireCapability(CMD_STOCKPILE); command = Command(CMD_STOCKPILE, order.kind == 1009 ? RIGHT_MOUSE_KEY : 0); - } else if ((order.kind == CMD_ATTACK || order.kind == CMD_MANUALFIRE) && order.target == 0xffffffff) { + } else if ((order.kind == CMD_ATTACK || order.kind == CMD_MANUALFIRE || order.kind == BAR_MANUAL_LAUNCH) && order.target == 0xffffffff) { requireCapability(order.kind); if (!validPosition()) status = 3; else command.PushPos(float3(order.x, CGround::GetHeightReal(order.x, order.z), order.z)); - } else if (order.kind == CMD_ATTACK || order.kind == CMD_MANUALFIRE) { + } else if (order.kind == CMD_ATTACK || order.kind == CMD_MANUALFIRE || order.kind == BAR_MANUAL_LAUNCH) { const CUnit* target = unitHandler.GetUnit(order.target); if (target == nullptr || target->isDead || teamHandler.Ally(gu->myAllyTeam, target->allyteam) || !WebbarVisible(target)) status = 4; @@ -358,7 +360,7 @@ } else if (order.kind != CMD_STOP) { status = 5; } - if (order.kind == CMD_PATROL || order.kind == CMD_MANUALFIRE) requireCapability(order.kind); + if (order.kind == CMD_PATROL || order.kind == CMD_MANUALFIRE || order.kind == BAR_MANUAL_LAUNCH) requireCapability(order.kind); if (status == 0 && order.kind != 1001) selectedUnitsHandler.SendCommandsToUnits(ids, {command}, false); }