mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Make sure noreload levels don't do anything weird with the skybox mobj pointers, especially if Lua was involved
We can assume skyboxviewpnts/skyboxcenterpnts sort themselves out from reloading all the Things at least I guess?
This commit is contained in:
parent
bdb3c2ea0e
commit
21950687ed
1 changed files with 15 additions and 0 deletions
|
|
@ -2276,6 +2276,17 @@ void P_LoadThingsOnly(void)
|
||||||
// Search through all the thinkers.
|
// Search through all the thinkers.
|
||||||
mobj_t *mo;
|
mobj_t *mo;
|
||||||
thinker_t *think;
|
thinker_t *think;
|
||||||
|
INT32 i, viewid = -1, centerid = -1; // for skyboxes
|
||||||
|
|
||||||
|
// check if these are any of the normal viewpoint/centerpoint mobjs in the level or not
|
||||||
|
if (skyboxmo[0] || skyboxmo[1])
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
{
|
||||||
|
if (skyboxmo[0] && skyboxmo[0] == skyboxviewpnts[i])
|
||||||
|
viewid = i; // save id just in case
|
||||||
|
if (skyboxmo[1] && skyboxmo[1] == skyboxcenterpnts[i])
|
||||||
|
centerid = i; // save id just in case
|
||||||
|
}
|
||||||
|
|
||||||
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
for (think = thinkercap.next; think != &thinkercap; think = think->next)
|
||||||
{
|
{
|
||||||
|
|
@ -2293,6 +2304,10 @@ void P_LoadThingsOnly(void)
|
||||||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||||
P_LoadThings();
|
P_LoadThings();
|
||||||
|
|
||||||
|
// restore skybox viewpoint/centerpoint if necessary, set them to defaults if we can't do that
|
||||||
|
skyboxmo[0] = skyboxviewpnts[(viewid >= 0) ? viewid : 0];
|
||||||
|
skyboxmo[1] = skyboxcenterpnts[(centerid >= 0) ? centerid : 0];
|
||||||
|
|
||||||
P_SpawnSecretItems(true);
|
P_SpawnSecretItems(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue