MantisBT - Zandronum
View Issue Details
0003153Zandronum[All Projects] Bugpublic2017-06-10 19:302017-06-12 21:39
Ivan 
 
normalminoralways
closedout of scope 
3.0-beta 
 
0003153: Clientside Enter script gives different value for ConsolePlayerNumber in Named and ordinary scripts
The example wad demonstrates the problem in greater detail. Just create a server locally and join, you'll observe the problem.
No tags attached.
? namedtest.pk3 (428) 2017-06-10 19:30
https://zandronum.com/tracker/file_download.php?file_id=2116&type=bug
c namedtest.c (214) 2017-06-10 19:33
https://zandronum.com/tracker/file_download.php?file_id=2117&type=bug
? namedtest2.pk3 (656) 2017-06-10 19:51
https://zandronum.com/tracker/file_download.php?file_id=2118&type=bug
txt disassembly-incorrect.txt (706) 2017-06-11 14:27
https://zandronum.com/tracker/file_download.php?file_id=2119&type=bug
txt disassembly-correct.txt (765) 2017-06-11 14:28
https://zandronum.com/tracker/file_download.php?file_id=2120&type=bug
Issue History
2017-06-10 19:30IvanNew Issue
2017-06-10 19:30IvanFile Added: namedtest.pk3
2017-06-10 19:33IvanFile Added: namedtest.c
2017-06-10 19:51Ru5tK1ngFile Added: namedtest2.pk3
2017-06-10 19:51Ru5tK1ngNote Added: 0017815
2017-06-11 14:19KorshunNote Added: 0017817
2017-06-11 14:26KorshunNote Edited: 0017817bug_revision_view_page.php?bugnote_id=17817#r10680
2017-06-11 14:27KorshunFile Added: disassembly-incorrect.txt
2017-06-11 14:28KorshunFile Added: disassembly-correct.txt
2017-06-11 14:35KorshunNote Added: 0017818
2017-06-11 14:36KorshunNote Deleted: 0017818
2017-06-11 14:36KorshunNote Edited: 0017817bug_revision_view_page.php?bugnote_id=17817#r10681
2017-06-11 14:36KorshunNote Edited: 0017817bug_revision_view_page.php?bugnote_id=17817#r10682
2017-06-11 14:38KorshunNote Edited: 0017817bug_revision_view_page.php?bugnote_id=17817#r10683
2017-06-12 21:39Edward-sanNote Added: 0017821
2017-06-12 21:39Edward-sanStatusnew => closed
2017-06-12 21:39Edward-sanResolutionopen => out of scope

Notes
(0017815)
Ru5tK1ng   
2017-06-10 19:51   
I think it is your compiler. I took your code and compiled it in namedtest2.pk3 and both numbers were 0 on the server.
(0017817)
Korshun   
2017-06-11 14:19   
(edited on: 2017-06-11 14:38)
Disassembling the objects using bccobjdump shows that both the incorrect scripts and all correct scripts use the same correct instructions (Full disassemblies attached).

The only notable difference is that the incorrect object uses:
-- SFLG (8)
script=800 flags=clientside
script=1 flags=clientside

While the correct one has:
-- SFLG (8)
script=800 flags=clientside
script=-1 flags=clientside

Which means named script -1 doesn't get marked as clientside. It runs serverside, where ConsolePlayerNumber() returns -1.

Instead, nonexistent script 1 is marked clientside. This is a compiler bug.

(0017821)
Edward-san   
2017-06-12 21:39   
I guess it's [Not a bug], then.