Sign in to follow this  

Wolfgang: bufferedaction set while in idle state after powerdown

  • Version: PC/MAC/Linux Pending

osx_steam, 379591. I think the world tested is Shipwrecked-compatible RoG, but this code is identical in all versions AFAIK.

With ActionQueue, I noticed what looks like a subtle bug in the game. Wolfgang's transformations (specifically powerdown) cause the stategraph to enter their respective states, and then unconditionally go into idle state - basically, Wolfgang stops whatever he's doing. However, wolfgang's buffered action doesn't get failed or cleared, so this action just hangs around until the player makes another SG transition that clears it (typically by moving).

        name = "powerdown",
        tags = {"busy"},
        onenter = function(inst)
        onexit = function(inst)
            EventHandler("animover", function(inst)"idle") end),

Actionqueue merely fetches an action using PlayerController:GetClickActions() and submits it back using PlayerController:DoAction(). The latter checks if the action submitted is the same as the one in the bufferedaction field, and returns immediately if the activity (PICK, HARVEST, etc.) and target match.

function PlayerController:DoAction(buffaction)
    if buffaction then
        if self.inst.bufferedaction then
            if self.inst.bufferedaction.action == buffaction.action and == then

So what happens is that AQ submits "the same" action (it picks the action for the closest target, so of course it submits the same action if the previous fails for some reason), DoAction returns without doing anything, and the cycle repeats.


Of course, the effect (idle SG state with non-nil buffered action, character not doing anything) is observed without the mod as well, though it's extremely easy to miss as moving or clicking another actionable target rectifies the issue.



Steps to Reproduce
  1. c_spawn("grass",100)
  2. c_sethunger(0.36)
  3. c_select(GetPlayer(); hit backspace
  4. Keep clicking on the spawned grass (IME this always selects the same entity until that grass is harvested), eventually leading to a situation that powerdown event hits while you're in the dolongaction state.
  5. After the powerdown state, character is in the idle state, with buffered action set. 
Sign in to follow this  

User Feedback

There are no comments to display.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now