ID:2618787
 
BYOND Version:513
Operating System:Windows 10 Home
Web Browser:Chrome 85.0.4183.121
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
The animate() procedure is not using icon_state in each rule of the argument.

Numbered Steps to Reproduce Problem:
animate(mob,icon_state = "something",time = 5)
animate(icon_state = "something_else")


Code Snippet (if applicable) to Reproduce Problem:
animate(mob,icon_state = "something",time = 5)
animate(icon_state = "something_else")


Expected Results:
The icon_state should only be used in the step it's on.

Actual Results:
The final icon_state in the set of steps is being used and not changed per step. In the above example "something_else" is being used over "something" even in the first step.

Does the problem occur:
Every time? Or how often? Every time.
In other games? Not sure.
In other user accounts? Yes.
On other computers? Yes.

When does the problem NOT occur?
Don't define icon_state in the steps which kind of messes with the whole thing. So Ignore icon_state entirely or define it step by step in another manner.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
No. it started to occur when 513 hit.

Workarounds:
Create another way to handle icon states.
You didn't specify a time in the second call.
Shouldn't the time in the first call be used before going to the second step? That's how it used to work anyway.
In response to Cecil81067
Yes, it should. What happens if you have a time on step 2?
This does not work. I thought it was working but I was running the fixed one where I don't let animate control icon_state my apologies.

So basically.

animate(mob,icon_state = "something",time = 5)
animate(icon_state = "something_else",time = 5)


This doesn't work either. Before it used to do step 1 until timer is out then go to step 2. I'm not sure how this may affect other icon_state switching either. The dm says that icon_states are instant not gradual like other steps so I assumed (and it worked before) that once the animate step began icon_state would be changed.

If I were to break it down in frames before it should work like so.

animate_begin
Frames:
1 - icon_state = "something"
2 - nothing
3 - nothing
4 - nothing
5 - nothing
6 - icon_state = "something_else"
animate_end

Instead it does:

animate_begin
Frames:
1 - icon_state = "something" and icon_state = "something_else"
2 - nothing
3 - nothing
4 - nothing
5 - nothing
6 - nothing

Now I'm not sure specifically what this code is doing.
I ran a test on this but my test case is not reproducing your issue.

mob/verb/StateBug()
animate(src, icon_state="dizzy", time=50)
animate(icon_state="", time=50)

In my test project this correctly causes the icon state to become "dizzy" for 5 seconds, then switch back to normal.

Do you have a test case that shows something different?
I tested this again recently and got the same result. I'm not sure how to get you a test realm without sending an entire source code. Gonna see if I can create a new environment to send to you. Might take me a minute.
Thanks. If you can get this to happen in a test environment that'd be great. If you can't do it in a simple case, it tells me that what you probably have is multiple animations interacting in some way, so that's what you would want to look for in your code.

This is one of the reasons I'm usually such a stickler for getting a test case, because often even if a simple snippet triggers a bug, it may do so for reasons beyond the scope of that snippet, and the problem disappears when trying to replicate it elsewhere.