MantisBT - Zandronum
View Issue Details
0001022Zandronum[All Projects] Bugpublic2012-09-07 10:222018-09-30 23:00
unknownna 
Edward-san 
normalminoralways
closedfixed 
1.0 
1.42.0 
0001022: Rotating polyobjects aren't reset after map resets online
Rotating polyobjects are still rotating after map resets online.
1. zandronum.exe -host -file polyobject_test_03.wad +survival 1
2. Connect a client to the server and join the game.
3. Push the switch before the warm-up countdown ends.
No tags attached.
related to 0001102closed Edward-san PolyObject desync when using this code 
related to 0000830feedback TIHan Poly objects with more than one thinker were not properly reset on map reset. 
? polyobject_test_03.wad (2,824) 2012-09-07 10:22
https://zandronum.com/tracker/file_download.php?file_id=695&type=bug
zip polyobject_test_03b.wad.zip (14,630) 2012-09-07 21:30
https://zandronum.com/tracker/file_download.php?file_id=696&type=bug
Issue History
2012-09-07 10:22unknownnaNew Issue
2012-09-07 10:22unknownnaFile Added: polyobject_test_03.wad
2012-09-07 10:22unknownnaStatusnew => confirmed
2012-09-07 11:54DuskAssigned To => Dusk
2012-09-07 11:54DuskStatusconfirmed => assigned
2012-09-07 12:38DuskNote Added: 0004608
2012-09-07 21:06DuskNote Added: 0004614
2012-09-07 21:06DuskNote Edited: 0004614bug_revision_view_page.php?bugnote_id=4614#r2495
2012-09-07 21:30DuskNote Added: 0004615
2012-09-07 21:30DuskFile Added: polyobject_test_03b.wad.zip
2012-09-07 21:31DuskStatusassigned => needs review
2012-09-08 19:00Torr SamahoNote Added: 0004624
2012-09-08 19:00Torr SamahoStatusneeds review => feedback
2012-09-30 00:31DuskStatusfeedback => assigned
2012-09-30 00:44DuskNote Added: 0004853
2012-09-30 00:44DuskStatusassigned => needs review
2012-09-30 06:58Torr SamahoNote Added: 0004857
2012-09-30 06:59Torr SamahoStatusneeds review => feedback
2012-09-30 14:27DuskNote Added: 0004880
2012-09-30 14:48DuskStatusfeedback => needs review
2012-09-30 19:45Torr SamahoNote Added: 0004886
2012-09-30 19:45Torr SamahoStatusneeds review => feedback
2015-01-15 18:38Edward-sanNote Added: 0011387
2015-01-15 18:44Edward-sanAssigned ToDusk => Edward-san
2015-01-15 18:44Edward-sanStatusfeedback => needs review
2015-01-16 19:51Edward-sanNote Edited: 0011387bug_revision_view_page.php?bugnote_id=11387#r6415
2015-01-17 10:30cobaltStatusneeds review => needs testing
2015-01-17 10:30cobaltTarget Version => 1.4
2015-01-17 10:30cobaltSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6421#r6421
2015-01-17 10:30cobaltNote Added: 0011404
2015-01-17 11:10Edward-sanRelationship addedrelated to 0001102
2015-01-17 11:10Edward-sanRelationship addedrelated to 0000830
2015-03-29 20:20DuskStatusneeds testing => resolved
2015-03-29 20:20DuskFixed in Version => 2.0
2015-03-29 20:20DuskResolutionopen => fixed
2018-09-30 23:00Blzut3Statusresolved => closed

Notes
(0004608)
Dusk   
2012-09-07 12:38   
Great to see you again unknownna! :)
(0004614)
Dusk   
2012-09-07 21:06   
also noticed that if a polyobj is still in move while the reset happens, the switch cannot be activated again

(0004615)
Dusk   
2012-09-07 21:30   
fixed:'https://bitbucket.org/CrimsonDusk/neurosphere/changeset/f2cd2ce477490c5d81605063391439fdd807f79c [^]'

There were problems in both moving and rotating polyobjects that were still in move at a map reset. The thinker wasn't deleted properly and the sound sequence wasn't stopped.. the existing code only catered for doors, I generalized it.
Attached edited test case wad with sound sequence
(0004624)
Torr Samaho   
2012-09-08 19:00   
Do you intentionally use pPolyAct->GetPolyObj() instead of pPoly as argument of SERVERCOMMANDS_PlayPolyobjSound? At first glance I'd say both should do the same, but since you call pPolyAct->Destroy( ) destroy before SERVERCOMMANDS_PlayPolyobjSound and SN_StopSequence uses pPoly, it's probably safer to use pPoly as argument.

Also, instead of adding three (NETWORK_GetState( ) == NETSTATE_SERVER) checks one should be enough if you put it into an outer if. IMHO this also makes the code a little easier to read.
(0004853)
Dusk   
2012-09-30 00:44   
OK I went around and fixed that:
'https://bitbucket.org/CrimsonDusk/neurosphere/changeset/ba33a6fd7559f59f0028e262b6c1429270cbb885 [^]'

pPoly - polyobjs didn't seem to provide the correct value, so I did that instead.
(0004857)
Torr Samaho   
2012-09-30 06:58   
Looks good except for one thing: Did you intentionally remove "pPoly->specialdata = NULL"? You call Destroy() on the object pPoly->specialdata is pointing to, so I'd say you should also NULL the pointer to the destroyed object like it was done before.
(0004880)
Dusk   
2012-09-30 14:27   
I suppose..

Addressed
(0004886)
Torr Samaho   
2012-09-30 19:45   
Unfortunately, I noticed another issue while reading the latest version: You cast pPoly->specialdata to DPolyAction* and then call pPolyAct->GetPolyObj( ) without checking whether the cast was successful. If pPoly->specialdata is not of type DPolyAction, this will crash. The old code did this properly: It cast pPoly->specialdata to DPolyAction and then checked whether the result was NULL. So instead of

            // [Dusk] If a polyobj thinker of any kind exists, it needs to be destroyed
            DPolyAction* pPolyAct = NULL;

            if ( pPoly->specialdata )
            {
                pPolyAct = static_cast<DPolyAction*>( pPoly->specialdata );

you should do

            // [Dusk] If a polyobj thinker of any kind exists, it needs to be destroyed
            DPolyAction* pPolyAct = static_cast<DPolyAction*>( pPoly->specialdata );

            if ( pPolyAct )
            {

I'm sorry that I didn't notice this earlier.
(0011387)
Edward-san   
2015-01-15 18:38   
(edited on: 2015-01-16 19:51)
I don't like to wait. :)

(0011404)
cobalt   
2015-01-17 10:30   
Issue addressed by commit c51a452df562: - Fixed: Rotating polyobjects did not stop on map resets (fixes 1022).
Committed by edward_san [edward-san] on Thursday 15 January 2015 19:36:54

Changes in files:
 docs/zandronum-history.txt | 1 +
 src/g_game.cpp | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletions(-)