Dragging - Fix corpse position desync#11396
Conversation
|
sample trace, triggered by commenting out exit on line 57 the body position looked fine the whole time, but We have to remember that this func runs on all machines So my gut reaction is that we might want to limit the number of retries or be more flexible on offset error |
| // Wait one frame after sync | ||
| if (_state == STATE_SYNC_PENDING) exitWith {_args set [0, STATE_VERIFY]}; | ||
|
|
||
| if (getPosATL _corpse distance _posATL < POSITION_THRESHOLD) then { |
There was a problem hiding this comment.
maybe be more accepting of some offset and only retry if it's really bad?
I'm not sure about this, just worried about doing setPosATL more than needed
| if (getPosATL _corpse distance _posATL < POSITION_THRESHOLD) then { | |
| if (getPosATL _corpse distance _posATL < (2 * POSITION_THRESHOLD)) then { |
Not convinced it's that. It wouldn't surprise me if I hadn't covered all cases, as I didn't want the code to be too performance intensive.
A while ago, KK was addressing a bug where you couldn't open inventories of dead bodies. He fixed it in a profiling build and I tested it, but found that corpses that were generated by setting the unit's health to 0 in the editor were still broken. He told me he wouldn't touch that (see https://feedback.bistudio.com/T126030#2564403). I'm really not a fan of trying to set a corpse's position numerous times (looks like in Pabst's example it's 10), especially since it runs |
When merged this pull request will:
Over the last few months, I've noticed that corpse dragging often fails to move a dead body to its new position in multiplayer on a dedicated server. I'm not sure when this started, maybe since some Arma update (2.20?).
I preserved the original @johnb432 command order (
setDir+setPos, followed byawake true+awake falsein the next frames) and added a PFH to handle desync.So far tested this only in
dedicated server + client + headless clientandhosted multiplayer + clientconfigurations.The following script can be used to reproduce the issue (create a player and a unit with health = 0):
The issue occurs most frequently on the first drag+drop operation after a server
#restart.