Bug Tracker – Bug 590

Player is not preserved between levels

Last modified: 2011-05-31 03:06:39 UTC
Bug 590 - Player is not preserved between levels
Summary: Player is not preserved between levels
Alias: None
Product: Odamex
Classification: Unclassified
Component: Server (show other bugs)
Version: (old) 0.5.0 - 0.5.5
Hardware: All All
: P2 major
Assignee: Odamex Bug Reporter
Depends on:
Blocks: 424 567
  Show dependency tree
Reported: 2010-07-08 23:52 UTC by Kyle
Modified: 2011-05-31 03:06 UTC (History)
4 users (show)

See Also:


Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle 2010-07-08 23:52:45 UTC
Using r1647, player's health/weapons/ammo/armor is not preserved between levels. This reportedly doesn't happen to all clients.
Comment 1 Ralph Vickers 2010-07-14 23:41:43 UTC
Have not been able to reproduce
Comment 2 Kyle 2010-07-15 06:20:46 UTC
Yes. This appears to be fixed. Closing bug. Will reopen if I experience the issue again.
Comment 3 Kyle 2010-08-01 18:57:23 UTC
Hex_Vulture reports that this is still happening.

< HeX9109> Reproduced
< HeX9109> Had 4 of the same clients in a server, used player 4 to gather stuff in e1m1 and exit
< HeX9109> next level I kept stuffs
< HeX9109> I join a server with player 5 and switch to player 1, next level I lose everything
Comment 4 Ralph Vickers 2010-08-21 04:30:27 UTC
Hex and I figured out how to reproduce this earlier. When players connect to Odamex servers, the server continues to assign higher and higher player ids. When a player's ID is equal or greater to 5, they will lose all items/weapons/status on every level change. Any players in the 1-4 range will keep their items.
Comment 5 Mike Wood 2010-08-21 11:54:02 UTC
Fixed in r1762. Please test.
Comment 6 Ralph Vickers 2010-08-21 19:53:49 UTC
Tested with Ladna, Hex, and Almn on r1762. Fix seems to work! Great job Hyper Eye, marking resolved
Comment 7 HeX_Vulture 2011-05-31 03:06:39 UTC
I'm going to go ahead and paste some IRC chat log in here just in case this breaks again:

[19:56] <@Hyper_Eye> Hmmm... here was the commit log on that... - Add P_PreservePlayer() and use it to handle coop player preservation at level start.
[19:56] <@Hyper_Eye> - Use G_DoReborn() to handle coop player spawn at level start instead of P_SpawnPlayer().
[19:56] <@Hyper_Eye> Fixes bug 590
[19:57] <@Hyper_Eye> So.. I added the P_PreservePlayer() function to fix that bug.
[19:57] <@Hyper_Eye> I wonder if this was another code merge boo boo.
[19:58] <dr_sean> I don't see a call to P_PreservePlayer() in G_DoReborn()
[19:59] <@Hyper_Eye> Here is where the call was when it was implemented: http://odamex.net/svn/diff.php?repname=Odamex&path=%2Ftrunk%2Fcommon%2Fp_setup.cpp&rev=1762&peg=1762
[20:00] <@Hyper_Eye> It looks like it is missing.
[20:00] <dr_sean> ok, it's still in that same place
[20:00] <@Hyper_Eye> Oh... I must have goofed my search then.
[20:00] <dr_sean> it's in p_setup.cpp
[20:01] <@Hyper_Eye> Oh... it was renamed.
[20:01] <dr_sean> oh, yeah
[20:01] <dr_sean> I set up a printf in SV_PreservePlayer and it's definitely called in 0.6-dev, but it appears to do nothing, probably because some other function jacked the player's inventory prior
[20:04] <@Hyper_Eye> Well.. I'll toss in a breakpoint and see which condition is not being met.
[20:04] <dr_sean> I'm doing the same
[20:14] <@Hyper_Eye> yeah... by the time it gets there it shows me only owning a pistol and fist.
[20:14] <@Hyper_Eye> I'm betting this is a p_mobj merge issue...
[20:17] <@Hyper_Eye> I would suspect P_SpawnMapThing()
[20:18] <@Hyper_Eye> I think I may be onto it.
[20:18] <dr_sean> ok, i'm comparing that function side-by-side with the 0.5.1 version
[20:20] <@Hyper_Eye> I'm about to try a change.
[20:26] <@Hyper_Eye> yeah... merge bug.
[20:26] <@Hyper_Eye> Is there a ticket for this issue?
[20:35] <dr_sean> I don't think there is
[20:36] <dr_sean> I'll post a bug to the tracker and then verify when it's committed or whatever
[20:37] <CIA-4> hypereye 0.6-dev * r2201 /common/p_mobj.cpp: The server should use SV_PreservePlayer() to handle spawning a coop player when the level changes.

This had to be re-fixed as of r2201