No start for player error after unconditional level exit

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

No start for player error after unconditional level exit

Post by drfrag »

After trying to port "- exported unconditional level exit to ZScript" now with DTS-T.pk3 after killing the boss brain in MAP16 it warps to MAP17 but gives a "no start for player 1 found" error in G_DoLoadLevel. Both start and pawndup are null in G_FinishTravel.
level.AllPlayerStarts.Size() == 0 in G_PickPlayerStart.
I don't know why it's happening. Any ideas? I need help with this, it's an important bug. Thanks.

Trace:

Code: Select all

>	gzdoom.exe!G_FinishTravel() Line 1389	C++
 	gzdoom.exe!G_DoLoadLevel(int position, bool autosave, bool newGame) Line 1087	C++
 	gzdoom.exe!G_DoWorldDone() Line 1293	C++
 	gzdoom.exe!G_Ticker() Line 1089	C++
 	gzdoom.exe!TryRunTics() Line 1995	C++
 	gzdoom.exe!D_DoomLoop() Line 1029	C++
 	gzdoom.exe!D_DoomMain() Line 2715	C++
 	gzdoom.exe!DoMain(HINSTANCE__ * hInstance) Line 991	C++
 	gzdoom.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * nothing, wchar_t * cmdline, int nCmdShow) Line 1323	C++
Locals:

Code: Select all

		autosave	true	bool
		i	8	int
		lastposition	2047108640	int
+		mapname	{Chars=0x000001a679033c3c "map17" }	FString
		newGame	false	bool
		oldgs	GS_LEVEL (0)	gamestate_t
		pnumerr	1	int
		position	2047108640	int
Patch:

Code: Select all

diff --git a/src/g_level.cpp b/src/g_level.cpp
index 9c74c6232..a1c1899c9 100644
--- a/src/g_level.cpp
+++ b/src/g_level.cpp
@@ -720,12 +720,39 @@ void G_ExitLevel (int position, bool keepFacing)
 	G_ChangeLevel(G_GetExitMap(), position, keepFacing ? CHANGELEVEL_KEEPFACING : 0);
 }
 
+static void LevelLocals_ExitLevel(int position, bool keepFacing)
+{
+	G_ExitLevel(position, keepFacing);
+}
+
+DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, ExitLevel, LevelLocals_ExitLevel)
+{
+	PARAM_PROLOGUE;
+	PARAM_INT(position);
+	PARAM_INT(keepFacing);
+	G_ExitLevel(position, keepFacing);
+	return 0;
+}
+
 void G_SecretExitLevel (int position) 
 {
 	level.flags3 |= LEVEL3_EXITSECRETUSED;
 	G_ChangeLevel(G_GetSecretExitMap(), position, 0);
 }
 
+static void LevelLocals_SecretExitLevel(int position)
+{
+	G_SecretExitLevel(position);
+}
+
+DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, SecretExitLevel, LevelLocals_SecretExitLevel)
+{
+	PARAM_PROLOGUE;
+	PARAM_INT(position);
+	G_SecretExitLevel(position);
+	return 0;
+}
+
 //==========================================================================
 //
 //
diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/base.zs
index 41c2b3b14..dabde4256 100644
--- a/wadsrc/static/zscript/base.zs
+++ b/wadsrc/static/zscript/base.zs
@@ -768,6 +768,9 @@ struct LevelLocals native
 	{
 		return Floor.CreateFloor(sec, floortype, ln, speed, height, crush, change, crushmode, hereticlower);
 	}
+
+	native void ExitLevel(int position, bool keepFacing);
+	native void SecretExitLevel(int position);
 }
 
 struct StringTable native
 
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: No start for player error after unconditional level exit

Post by _mental_ »

Pushed merged changes to legacy branch, 4f6ab52 and d801788.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: No start for player error after unconditional level exit

Post by drfrag »

Thanks very much!!! :wub:
In the end i fixed it myself changing the statics but your solution is cleaner. :)
Post Reply

Return to “Closed Bugs [GZDoom]”