MantisBT - Zandronum
View Issue Details
0000829Zandronum[All Projects] Bugpublic2012-05-01 19:482018-10-01 00:03
unknownna 
Dusk 
normalmajoralways
closedfixed 
98d 
1.41.4 
0000829: Players automatically pick up items upon spawn after changemap map changes in Coop/Survival
Quote from unknownna
It seems that players are hard coded to automatically pick up items upon spawn in (Team)Possession/Terminator.

This also happens in Coop/Survival after changemap map changes. But you don't actually pick up the items, they simply disappear.
1. skulltag.exe -file changemap_pickup_01.wad +map map01
2. "changemap map01" in the console.
3. Exit the intermission screen.
No tags attached.
related to 0000411closed Torr Samaho Players automatically pick up items upon spawn in (Team)Possession/Terminator 
has duplicate 0001574closed Dusk Spawning on items after map change results in no said items 
has duplicate 0001917closed  Upon changemap, player attempts to pick up any colliding Inventory items 
related to 0001983closed  weapon missing after teleporting within a hub, due to player destinations placed on top of items. 
? changemap_pickup_01.wad (2,330) 2012-05-01 19:48
/tracker/file_download.php?file_id=598&type=bug
png Screenshot_Doom_20120501_213945.png (31,997) 2012-05-01 19:49
/tracker/file_download.php?file_id=599&type=bug
png
Issue History
2012-05-01 19:48unknownnaNew Issue
2012-05-01 19:48unknownnaFile Added: changemap_pickup_01.wad
2012-05-01 19:49unknownnaFile Added: Screenshot_Doom_20120501_213945.png
2012-05-01 19:50unknownnaStatusnew => confirmed
2012-05-01 19:50unknownnaDescription Updatedbug_revision_view_page.php?rev_id=1918#r1918
2012-05-01 19:51unknownnaRelationship addedrelated to 0000411
2012-05-01 20:05DuskAssigned To => Dusk
2012-05-01 20:05DuskStatusconfirmed => assigned
2012-05-01 20:20DuskNote Added: 0003547
2012-05-01 20:20DuskStatusassigned => feedback
2012-05-01 20:29unknownnaNote Added: 0003549
2012-05-01 20:29unknownnaStatusfeedback => assigned
2012-05-01 20:32unknownnaNote Edited: 0003549bug_revision_view_page.php?bugnote_id=3549#r1920
2012-05-01 20:36DuskNote Added: 0003550
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug
2013-09-27 10:39DuskStatusassigned => confirmed
2013-11-10 12:03DuskRelationship addedhas duplicate 0001574
2014-10-07 02:46WatermelonRelationship addedrelated to 0001917
2015-01-02 15:42Edward-sanNote Added: 0011218
2015-01-02 15:43Edward-sanNote Edited: 0011218bug_revision_view_page.php?bugnote_id=11218#r6259
2015-01-02 15:45Edward-sanNote Edited: 0011218bug_revision_view_page.php?bugnote_id=11218#r6260
2015-01-02 15:46Edward-sanNote Edited: 0011218bug_revision_view_page.php?bugnote_id=11218#r6261
2015-01-02 15:46Edward-sanNote Edited: 0011218bug_revision_view_page.php?bugnote_id=11218#r6262
2015-01-02 15:57Edward-sanNote Edited: 0011218bug_revision_view_page.php?bugnote_id=11218#r6263
2015-01-03 21:20DuskRelationship addedrelated to 0001983
2015-01-04 00:01DuskNote Added: 0011256
2015-01-04 00:02DuskNote Edited: 0011256bug_revision_view_page.php?rev_id=6299
2015-01-04 01:42DuskNote Deleted: 0011256
2015-01-04 01:43DuskNote Added: 0011257
2015-01-04 01:43DuskStatusconfirmed => needs review
2015-01-04 09:17Torr SamahoNote Added: 0011261
2015-01-04 09:18Torr SamahoStatusneeds review => feedback
2015-01-04 09:26DuskNote Added: 0011263
2015-01-04 09:26DuskNote Edited: 0011263bug_revision_view_page.php?bugnote_id=11263#r6301
2015-01-04 10:02Torr SamahoNote Added: 0011265
2015-01-04 10:08cobaltStatusfeedback => needs testing
2015-01-04 10:08cobaltTarget Version => 1.4
2015-01-04 10:08cobaltDescription Updatedbug_revision_view_page.php?rev_id=6302#r6302
2015-01-04 10:08cobaltSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6304#r6304
2015-01-04 10:09cobaltNote Added: 0011266
2015-01-04 23:29WaTaKiDNote Added: 0011279
2015-01-05 12:09DuskRelationship replacedhas duplicate 0001917
2015-01-08 14:38ArcoStatusneeds testing => resolved
2015-01-08 14:38ArcoResolutionopen => fixed
2015-01-08 14:38ArcoFixed in Version => 1.4
2015-01-08 14:38ArcoDescription Updatedbug_revision_view_page.php?rev_id=6353#r6353
2015-01-08 14:38ArcoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6354#r6354
2018-10-01 00:03Blzut3Statusresolved => closed

Notes
(0003547)
Dusk   
2012-05-01 20:20   
I can reproduce this... but only offline. Does this happen in GZDoom r323?
(0003549)
unknownna   
2012-05-01 20:29   
(edited on: 2012-05-01 20:32)
> Does this happen in GZDoom r323?

'http://www.skulltag.com/forum/viewtopic.php?f=33&t=28053 [^]'

Quote from unknownna
Quote from Edward-san
Does it occurr in gzdoom 323? If yes, does it also in latest zdoom svn?

No. In GZDoom 323, the player only picks up the megasphere when s/he starts to move, or crouches.

> I can reproduce this... but only offline.

Strange. I'm able to reproduce it online. There's a difference between alwaysapplydmflags 1 and alwaysapplydmflags 0. The SSG isn't supposed to stay if sv_weaponstay is set to 0.

(0003550)
Dusk   
2012-05-01 20:36   
Ah, I had alwaysapplydmflags set to false, I can reproduce this now online.
(0011218)
Edward-san   
2015-01-02 15:42   
(edited on: 2015-01-02 15:57)
G_CheckSpot is called in G_CooperativeSpawnPlayer (which is called in G_FinishTravel), I suppose as an attempt to avoid telefrags, in g_game.cpp line 2561, but this will call PIT_CheckThing, which finds something (the supershotgun), then it calls P_TouchSpecialThing (which makes the pickup sound and disappear the supershotgun). There's no such thing in gzdoom 323 (well, there's no G_CooperativeSpawnPlayer, to begin with).


In other words, calling G_CheckSpot in that place seems to be a bad idea ..

(0011257)
Dusk   
2015-01-04 01:43   
'https://bitbucket.org/Torr_Samaho/zandronum-stable/pull-request/125 [^]'
(0011261)
Torr Samaho   
2015-01-04 09:17   
According to 0000829:0011218, calling G_CheckSpot in G_CooperativeSpawnPlayer is wrong in general (I vaguely remember that there also is a problem where players directly pickup weapons they spawn on instead of only picking them up after moving). If this is true, wouldn't it be much better to fix this call instead of doing a band aid that covers one instance of the problem?

For instance, we could introduce

bool G_CheckSpotNoPickup (int playernum, FMapThing *mthing)
{
  const bool hadPickup = ( players[playernum].mo && players[playernum].mo->flags & MF_PICKUP );
  // [TP/BB] Prevent the current player body from picking up anything with the G_CheckSpot call.
  if ( hadPickup )
    players[playernum].mo->flags &= ~MF_PICKUP;
  const bool ret = G_CheckSpot (playernum, mthing);
  // [BB] Restore the flag if necessary.
  if ( hadPickup )
    players[playernum].mo->flags |= MF_PICKUP;
  return ret;
}

(warning not tested, not even compiled) and call that one instead of G_CheckSpot.
(0011263)
Dusk   
2015-01-04 09:26   
Thinking about this again, I think pickups may be just one symptom caused by this problem. G_CooperativeSpawnPlayer uses G_CheckSpot to ensure the spot is available but this causes the player to interact with the spot. Perhaps G_CoperativeSpawnPlayer should instead be put to use something else.

edward-san suggested something like this and P_TestMobjLocation for the purpose. For the patch I though figured that doing something like this would probably cause strange side effects so I figured a simple band-aid would retain status quo better. After all, that's what we appear to generally do anyway.

(0011265)
Torr Samaho   
2015-01-04 10:02   
I also thought about this a bit more. ZDoom itself is also using G_CheckSpot when respawning players, so it can't be wrong in general to use it for respawning players (actually, I bet Carn used ZDoom's SelectRandomDeathmatchSpot/G_DeathMatchSpawnPlayer as base for G_CooperativeSpawnPlayer). Thus, it looks like the only problem is that we are using G_CheckSpot also for the dummy player. Since your patch takes care of exactly this issue, I'll pull it.
(0011266)
cobalt   
2015-01-04 10:09   
Issue addressed by commit d54d7116047c: - fixed: items at player starts would be inadvertently removed after a map change as G_FinishTravel uses G_CooperativeSpawnPlayer on Zandronum which, due to a series of function calls, caused the player body to pick up items. (fixes 829)
Committed by Teemu Piippo [Dusk] on Sunday 04 January 2015 01:57:11

Changes in files:
 docs/zandronum-history.txt | 1 +
 src/g_level.cpp | 4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
(0011279)
WaTaKiD   
2015-01-04 23:29   
after testing with 2.0-r150104-1712, issue seems fixed