MantisBT - Zandronum
View Issue Details
0002053Zandronum[All Projects] Bugpublic2015-01-04 23:022018-09-30 23:08
WaTaKiD 
Torr Samaho 
normalminoralways
closedfixed 
MicrosoftWindowsXP/Vista/7
2.0-beta 
2.02.0 
0002053: sv_nomonsters 1 changes spawn direction in next map
online or offline in 2.0, having sv_nomonsters 1 while exiting will have u spawn in the next map facing the direction u were when u exited, rather than the player start's direction
load any zandro 2.0 build with doom2.wad map01
sv_nomonsters 1
exit while facing the switch at an angle
should spawn in map02 not facing the normal direction
does not happen in gzdoom r900 or zdoom 2.5.0/2.6.0 singleplayer or multiplayer
No tags attached.
Issue History
2015-01-04 23:02WaTaKiDNew Issue
2015-01-04 23:24WaTaKiDNote Added: 0011278
2015-01-05 00:50Edward-sanNote Added: 0011281
2015-01-05 00:51Edward-sanNote Edited: 0011281bug_revision_view_page.php?bugnote_id=11281#r6310
2015-01-05 01:33Edward-sanNote Edited: 0011281bug_revision_view_page.php?bugnote_id=11281#r6311
2015-01-05 01:34Edward-sanAssigned To => Torr Samaho
2015-01-05 01:34Edward-sanStatusnew => assigned
2015-01-05 19:38Torr SamahoNote Added: 0011289
2015-01-05 19:39Torr SamahoStatusassigned => needs testing
2015-01-05 19:39Torr SamahoTarget Version => 2.0
2015-01-05 19:56cobaltNote Added: 0011290
2015-01-05 19:57DuskNote Edited: 0011290bug_revision_view_page.php?bugnote_id=11290#r6325
2015-01-05 22:56WaTaKiDNote Added: 0011303
2015-01-08 14:39ArcoStatusneeds testing => resolved
2015-01-08 14:39ArcoResolutionopen => fixed
2015-01-08 14:39ArcoFixed in Version => 2.0
2018-09-30 23:08Blzut3Statusresolved => closed

Notes
(0011278)
WaTaKiD   
2015-01-04 23:24   
sorry i forgot to list the earliest 2.0 build that i tested (and could find):
2.0-r131223-1820
(0011281)
Edward-san   
2015-01-05 00:50   
(edited on: 2015-01-05 01:33)
It started breaking from changeset abc921f3c681 .

Found out why: when sv_nomonsters is on, zandronum, when calling G_ExitLevel, passes to G_ChangeLevel the nomonsters flag, in order to preserve the nomonsters behavior when the next map is loaded. Zdoom, instead, does not. Inside G_ChangeLevel, flags is 4 and its value is saved in the static variable changeflags. This seems innocent, but the problem starts in G_FinishTravel, when this condition is checked:


if (!changeflags & CHANGELEVEL_KEEPFACING)


and ... surprise! bad logic here: negation is applied on changeflags, not on the result of the 'and', changing the result from 'true' to 'false', hence 'angle' and 'pitch' of the pawn is not reset.
Actually, zdoom fixed this when another problem was arisen in this bug thread, when the same identical problem happened to the 'ChangeLevel' ACS function. It was fixed in r3444.

(0011289)
Torr Samaho   
2015-01-05 19:38   
Thanks, Edward-san, for the detailed analysis! I backported the ZDoom fix.
(0011290)
cobalt   
2015-01-05 19:56   
(edited on: 2015-01-05 19:57)
Issue addressed by commit 923acc61f1b6: out of sequence fix backport from ZDoom revision 3444: - Fixed: The check for CHANGELEVEL_KEEPFACING in G_FinishTravel() needed parentheses. This addresses the 2.0 specific problems reported in 2053.
Committed by Benjamin Berkels [Torr Samaho] on Monday 05 January 2015 20:35:38

Changes in files:
 src/g_level.cpp | 2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

(0011303)
WaTaKiD   
2015-01-05 22:56   
after testing with 2.0-r150105-2058, issue seems fixed