In the middle of the component PlayerController:OnUpdate, there's a check:
if self.handler ~= nil and self.inst:HasTag("usingmagiciantool") then self:CancelPlacement() self:CancelDeployPlacement() self:CancelAOETargeting() end
However, below this, there's a check to see if the player has an item on their cursor, which then starts placement mode:
local placer_item = controller_mode and self:GetCursorInventoryObject() or self.inst.replica.inventory:GetActiveItem() --show deploy placer if self.deploy_mode and self.placer == nil and placer_item ~= nil and placer_item.replica.inventoryitem ~= nil and placer_item.replica.inventoryitem:IsDeployable(self.inst) then local placer_name = placer_item.replica.inventoryitem:GetDeployPlacerName() local placer_skin = placer_item.AnimState:GetSkinBuild() --hack that relies on the build name to match the linked skinname if placer_skin == "" then placer_skin = nil end if self.deployplacer ~= nil and (self.deployplacer.prefab ~= placer_name or self.deployplacer.skinname ~= placer_skin) then self:CancelDeployPlacement() end if self.deployplacer == nil then self.deployplacer = SpawnPrefab(placer_name, placer_skin, nil, self.inst.userid ) if self.deployplacer ~= nil then self.deployplacer.components.placer:SetBuilder(self.inst, nil, placer_item) self.deployplacer.components.placer.testfn = function(pt) local mouseover = TheInput:GetWorldEntityUnderMouse() return placer_item:IsValid() and placer_item.replica.inventoryitem ~= nil and placer_item.replica.inventoryitem:CanDeploy(pt, mouseover, self.inst, self.deployplacer.Transform:GetRotation()), (mouseover ~= nil and not mouseover:HasTag("walkableplatform") and not mouseover:HasTag("walkableperipheral") and not mouseover:HasTag("ignoremouseover")) or TheInput:GetHUDEntityUnderMouse() ~= nil end self.deployplacer.components.placer:OnUpdate(0) --so that our position is accurate on the first frame end end else self:CancelDeployPlacement() end
In the case of deploy-placement, this means that on every frame placement is cancelled and restarted immediately on the same frame.
It seems that the intent here was to not allow placement, but placement is actually functional despite this, somehow. Rather than thrashing on creating and destroying the placer, maybe this should just allow placement? Or the placer creation block should check the same condition to avoid thrashing.
This is particularly problematic with the Geometric Placement mod, because creating placers creates a grid, which is more expensive than just destroying and recreating the placer itself.
c_give("tophat_magician")
c_give("pinecone")
Put the hat on, open its inventory, then pick up the pinecone on the cursor and move the mouse. Compare to moving the mouse without the hat open.
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now