G_DoReborn crashes

Status
Not open for further replies.

Yacker

Metallic
If I call G_DoReborn at all in single player it crashes after the fadeout with the error: P_MapStart: tmthing set! But in multiplayer it works fine. Am I missing something or is this function just broken?

Code:
addHook("ThinkFrame", function()
	for p in players.iterate
		if p.cmd.buttons & BT_USE
			G_DoReborn(0)
		end
	end
end)
 
Probably the latter, I don't think G_DoReborn was intended to be used in the gamelogic code outside of netgames, since that would mean it actually loads the map ...before it finished doing gamelogic code within the current map.

Might be better if you used p.playerstate = PST_REBORN instead, that way the game will basically call G_DoReborn(#p) when it's safe to do so.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top