Cyberdemon
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > bugfix
 
Author
All times are GMT. The time now is 15:26. Post New Thread    Post A Reply
Anders
No one knows I'm schepe


Posts: 428
Registered: 03-02


Quasar, i decided to have a look at that bug we talked about.

After lots of tracking and comparing with linux doom's sources i found the cause, and a possible solution.

this is the code in G_DoLoadLevel() that makes sure the player get a fresh (ie. pistol, 100% health) start if he enters the level dead.
code:
for(i = 0; i < MAXPLAYERS; i++) { if(playeringame[i] && players[i].playerstate == PST_DEAD) players[i].playerstate = PST_REBORN; memset(players[i].frags, 0, sizeof(players[i].frags)); }


this doesn't work in eternity, because it calls P_SetupLevel() BEFORE this code, while linux doom calls P_SetupLevel() AFTER this code.

P_SetupLevel() calls P_SpawnPlayer() which does this:
code:
if(p->playerstate == PST_REBORN) G_PlayerReborn(mthing->type - 1);

but in eternity playerstate will be PST_DEAD when it enters P_SpawnPlayer and thus the player isn't given the pistol and health.

further down in P_SpawnPlayer():
code:
p->playerstate = PST_LIVE;


So, the playerstate will just be set from PST_DEAD to PST_LIVE without the player being given the pistol and health.

The obvious solution is to move the call to P_SetupLevel (in G_DoLoadLevel() ) so it'll get called after the code above, or will that that cause other problems?

I tried this, and the testdemo i had erik make worked fine.

__________________
++++++++++[>++++++++++>++++++++++++>+++++++++++>++
+>+<<<<<-]>.>-.>>++.<<<++.>>+.+++.<--.>-----.+++++
+.>.<<<-----.>>-.<<++++.>>>.<<<++.------.>++++.>>>.

Last edited by Anders on 12-27-03 at 07:26

Old Post 12-27-03 02:54 #
Anders is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit || Quote
All times are GMT. The time now is 15:26. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Eternity > bugfix

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.