Zandronum Chat @
Get the latest version: 3.0
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002776Zandronum[All Projects] Bugpublic2016-07-11 16:002017-08-06 19:07
Assigned ToDusk 
PlatformOSOS Version
Product Version3.0-beta 
Target Version3.0Fixed in Version 
Summary0002776: FindStateLabelAndOffset flaws
DescriptionI was going to refactor FindStateLabelAndOffset into a member of AActor and have it return a struct containing the information (mostly because it would be a useful method to use in debugging to find out in which state the actor really is) and realized that the approach is quite flawed.

It was based on the dumpstates console command, whose purpose is to find the state labels of an actor and the owners of these labels. But FindStateLabelAndOffset only returns the state label and offset, not the owner. So what if the actor is in a shadowed state of its ancestor? (e.g. goto Super::Spawn + 2) Then it would only return Spawn + 2, which would be wrong. So it also needs to return the owner.

Furthermore, this is used in server commands code, to give a network-friendly representation of the state. Okay, but why label and offset? The label is just that, a label, and also lacks the owner so shadowed states would be sent wrong.

Wouldn't it be better to send the actor class who owns the state, and the offset from SpawnState? That would not be subject to this problem. I'll try to piece together a test case.
Attached Files

- Relationships
parent of 0002832resolvedDusk Incorrect Jump Frame Errors 
parent of 0003107resolved Issues with weapon switching and state jumps 

-  Notes
User avatar (0015280)
Dusk (developer)
2016-07-11 17:43

Okay, SERVERCOMMANDS_SetThingFrame does have enough safeguards to prevent this from causing desyncs but IMO the code is still needlessly complicated.
User avatar (0015282)
Torr Samaho (administrator)
2016-07-11 19:35

Quote from Dusk
Wouldn't it be better to send the actor class who owns the state, and the offset from SpawnState?
That could work. It would be surely nice to simplify the current approach. If you get this to work reliably, I'm all for it.
User avatar (0015293)
Dusk (developer)
2016-07-12 16:54

Here goes. AOW2 turned out to be a rather useful test case for this.

Turns out I cannot use the offset from SpawnState, because it isn't necessarily the first defined state of the actor. It isn't even owned by the actor, if the actor inherits it. So OwnedStates needs to be used instead, as &OwnedStates[0] is the first state the actor actually owns.
User avatar (0016236)
Torr Samaho (administrator)
2016-11-21 07:07

I added this a while a ago. Unfortunately, it seems to have led to a new problem: 0002832.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2016-07-11 16:00 Dusk New Issue
2016-07-11 17:43 Dusk Note Added: 0015280
2016-07-11 19:35 Torr Samaho Note Added: 0015282
2016-07-12 16:54 Dusk Note Added: 0015293
2016-07-12 16:54 Dusk Assigned To => Dusk
2016-07-12 16:54 Dusk Status new => needs review
2016-11-20 21:38 Edward-san Product Version 3.0 => 3.0-beta
2016-11-21 07:06 Torr Samaho Relationship added parent of 0002832
2016-11-21 07:07 Torr Samaho Note Added: 0016236
2016-11-21 07:09 Torr Samaho Status needs review => needs testing
2016-12-24 22:42 Dusk Target Version => 3.0
2017-04-30 20:19 WaTaKiD Relationship added parent of 0003107
2017-08-06 19:07 Dusk Status needs testing => resolved
2017-08-06 19:07 Dusk Resolution open => fixed

Questions or other issues? Contact Us.


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker