MantisBT - Zandronum
View Issue Details
0003666Zandronum[All Projects] Bugpublic2019-06-22 08:472022-09-18 17:16
auratoostronk 
 
normalcrashalways
closedno change required 
PCWindows 1010.0.17763
3.0 
 
0003666: Sine and Cosine functions in decorate not working on servers?
I'm using the following decorate code to fire a shotgun in a consistant circular pattern every time it is fired. It works fine in offline skirmish but I've tested it on TSPG's hosting service and on my own server from my own device and when it fires the game freezes until I have to close it. It does not affect the server but only the client i.e. other players on the server are not affected.
This is my code for the shotgun:

Fire:
        TNT1 A 0 ACS_NamedExecuteAlways("PauseEnergyRegen", 0)
        TNT1 A 0 A_TakeInventory("StealthTic", 999)
        TNT1 A 0 A_FireCustomMissile("PurpleFlashShoot", 0, false)
        TNT1 A 0 A_PlayWeaponSound("ParticleSplitter/Fire")
        TNT1 A 0 A_Recoil(6)
        TNT1 A 0 Bright A_FireCustomMissile("SGPellet", frandom(-3.0, 3.0), true, 0.0, -1.0, 0, frandom(-3.0, 3.0))
        TNT1 A 0 A_SetArg(0, 0)
        TNT1 A 0 A_SetArg(1, 0)
    Fire1:
        TNT1 A 0 A_FireCustomMissile("SGPellet", 1.8*cos(args[0]), false, 0.0, -1.0, 0, 1.8*sin(args[0]))
        TNT1 A 0 A_FireCustomMissile("SGPellet", 3.0*cos(args[0]), false, 0.0, -1.0, 0, 3.0*sin(args[0]))
        TNT1 A 0 A_SetArg(0, args[0] + 30)
        TNT1 A 0 A_JumpIf(args[0] >= 360, "Fire2")
        Goto Fire1
    Fire2:
        TNT1 A 0 A_FireCustomMissile("SGPellet", 0.8*cos(args[1]), false, 0.0, -1.0, 0, 0.8*sin(args[1]))
        TNT1 A 0 A_FireCustomMissile("SGPellet", 4.0*cos(args[1]), false, 0.0, -1.0, 0, 4.0*sin(args[1]))
        TNT1 A 0 A_SetArg(1, args[1] + 60)
        TNT1 A 0 A_JumpIf(args[1] >= 360, "FireFinish")
        Goto Fire2
    FireFinish:
        PSGF ABCBA 1
        Goto Pump
I've recorded the footage of both the offline skirmish with bots and myself on my server. The files are too big to put here so I posted links to the videos on my google drive.

'https://drive.google.com/open?id=17U5qGP6lEWvHytlmjKlXfdaS1QKT4afE [^]'

'https://drive.google.com/open?id=12WMOkagcGkxR-185MwugSlDKc6Ib-X_0 [^]'
No tags attached.
txt FIRE STATES.txt (1,022) 2022-06-11 09:01
/tracker/file_download.php?file_id=2752&type=bug
? testingabug.pk3 (514) 2022-06-11 09:22
/tracker/file_download.php?file_id=2753&type=bug
txt New Text Document.txt (1,017) 2022-09-16 08:28
/tracker/file_download.php?file_id=2779&type=bug
Issue History
2019-06-22 08:47auratoostronkNew Issue
2022-06-11 09:01auratoostronkNote Added: 0022265
2022-06-11 09:01auratoostronkFile Added: FIRE STATES.txt
2022-06-11 09:02auratoostronkNote Edited: 0022265bug_revision_view_page.php?bugnote_id=22265#r13640
2022-06-11 09:22auratoostronkNote Added: 0022266
2022-06-11 09:22auratoostronkFile Added: testingabug.pk3
2022-09-16 08:28auratoostronkNote Added: 0022399
2022-09-16 08:28auratoostronkFile Added: New Text Document.txt
2022-09-16 08:30auratoostronkNote Edited: 0022399bug_revision_view_page.php?bugnote_id=22399#r13734
2022-09-18 17:16KaminskyNote Added: 0022401
2022-09-18 17:16KaminskyStatusnew => closed
2022-09-18 17:16KaminskyResolutionopen => no change required

Notes
(0022265)
auratoostronk   
2022-06-11 09:01   
(edited on: 2022-06-11 09:02)
I decided to take a tackle at this again, since I thought it might be an error on my part. It does not appear to be so. I uploaded my new code in a text document. The error occors in state Fire1, everything else is tested. Something about the sine/cosine functions don't want to work server side. I'll try to do more testing.

(0022266)
auratoostronk   
2022-06-11 09:22   
Interestingly the crash doesn't happen with hitscans it seems. I uploaded a working pk3 that does something similar but with A_FireBullets
(0022399)
auratoostronk   
2022-09-16 08:28   
(edited on: 2022-09-16 08:30)
I found a fix, and I think this issue is resolved. Swapping the "Jump If" statement to point back to the weapon state its in and changing the Goto state to the next weapon state fixes the issue. I posted it as "New Text Document" (sorry forgot the file name is visible here).

(0022401)
Kaminsky   
2022-09-18 17:16   
I'm closing this ticket now as the original issue didn't have anything to do with the sine or cosine DECORATE functions, nor did it affect the server. Rather, it was caused by an infinite loop in the "Fire1" state on the client's end (they cannot execute and will ignore jump functions on their end). Aura has found a fix to his problem since then.