Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Megalith's GetCommandQueue not functioning as expected #6578

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/snippets/sections/fix.6578.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6578) Fix Megalith's `GetCommandQueue` returning a hidden factory rally point queue instead of the Megalith's command queue.
6 changes: 5 additions & 1 deletion engine/Core/Categories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ categories = {
CONSTRUCTION = categoryValue,
CONSTRUCTIONSORTDOWN = categoryValue,
COUNTERINTELLIGENCE = categoryValue,
--- Allows queuing commands before the unit is finished building
CQUEMOV = categoryValue,
CRABEGG = categoryValue,
CRUISER = categoryValue,
Expand All @@ -85,10 +86,12 @@ categories = {
ECONOMIC = categoryValue,
ENERGYPRODUCTION = categoryValue,
ENERGYSTORAGE = categoryValue,
--- Unit counts as an engineer for GetIdleEngineers()
ENGINEER = categoryValue,
ENGINEERPRESET = categoryValue,
ENGINEERSTATION = categoryValue,
EXPERIMENTAL = categoryValue,
--- Replaces the unit's command queue with the rally point orders. Also gives it a default rally point order upon creation
FACTORY = categoryValue,
FAVORSWATER = categoryValue,
FERRYBEACON = categoryValue,
Expand Down Expand Up @@ -123,7 +126,7 @@ categories = {
NAVALCARRIER = categoryValue,
NAVAL = categoryValue,

-- Allows this unit to be build by engineers
--- Allows this unit to be built by engineers
NEEDMOBILEBUILD = categoryValue,
NOFORMATION = categoryValue,
--- Prevents splash damage being applied to the entity
Expand Down Expand Up @@ -154,6 +157,7 @@ categories = {
PRODUCTSC1 = categoryValue,
PROJECTILE = categoryValue,
RADAR = categoryValue,
-- Causes orders given to the unit to be added to the rally point queue
RALLYPOINT = categoryValue,
RAMBOPRESET = categoryValue,
RASPRESET = categoryValue,
Expand Down
2 changes: 1 addition & 1 deletion engine/User/UserUnit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ end
function UserUnit:GetBuildRate()
end

--- Returns a table of commands
--- Returns a table of commands. If the unit has the `FACTORY` category, returns the rally point command queue.
---@return UICommandInfo[]
function UserUnit:GetCommandQueue()
end
Expand Down
5 changes: 1 addition & 4 deletions lua/keymap/hotbuild.lua
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,7 @@ function buildAction(name)
local selection = GetSelectedUnits()
if selection then
-- If current selection is engineer or commander or megalith
if not table.empty(EntityCategoryFilterDown(categories.ENGINEER - categories.STRUCTURE, selection)) or
not
table.empty(EntityCategoryFilterDown(categories.FACTORY * categories.EXPERIMENTAL * categories.CYBRAN,
selection)) then
if not table.empty(EntityCategoryFilterDown(categories.ENGINEER - categories.STRUCTURE + categories.xrl0403, selection)) then
buildActionBuilding(name, modifier)
else -- Buildqueue or normal applying all the command
buildActionUnit(name, modifier)
Expand Down
1 change: 0 additions & 1 deletion units/XRL0403/XRL0403_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ UnitBlueprint{
"DIRECTFIRE",
"DRAGBUILD",
"EXPERIMENTAL",
"FACTORY",
"LAND",
"LOWSELECTPRIO",
"MOBILE",
Expand Down
Loading