mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'level-specials-setup-stuff-backport' into 'master'
Level specials setup stuff backport See merge request KartKrew/Kart!133
This commit is contained in:
commit
97caa08e4d
4 changed files with 51 additions and 37 deletions
16
src/p_mobj.c
16
src/p_mobj.c
|
|
@ -11531,20 +11531,16 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
mobjtype_t macetype = MT_SMALLMACE;
|
mobjtype_t macetype = MT_SMALLMACE;
|
||||||
boolean firsttime;
|
boolean firsttime;
|
||||||
mobj_t *spawnee;
|
mobj_t *spawnee;
|
||||||
size_t line;
|
INT32 line;
|
||||||
const size_t mthingi = (size_t)(mthing - mapthings);
|
const size_t mthingi = (size_t)(mthing - mapthings);
|
||||||
|
|
||||||
// Why does P_FindSpecialLineFromTag not work here?!?
|
// Find the corresponding linedef special, using angle as tag
|
||||||
// Monster Iestyn: tag lists haven't been initialised yet for the map, that's why
|
// P_FindSpecialLineFromTag works here now =D
|
||||||
for (line = 0; line < numlines; line++)
|
line = P_FindSpecialLineFromTag(9, mthing->angle, -1);
|
||||||
{
|
|
||||||
if (lines[line].special == 9 && lines[line].tag == mthing->angle)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (line == numlines)
|
if (line == -1)
|
||||||
{
|
{
|
||||||
CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle);
|
CONS_Debug(DBG_GAMELOGIC, "Mace chain (mapthing #%s) needs to be tagged to a #9 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -2791,8 +2791,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
|
|
||||||
postimgtype = postimgtype2 = postimgtype3 = postimgtype4 = postimg_none;
|
postimgtype = postimgtype2 = postimgtype3 = postimgtype4 = postimg_none;
|
||||||
|
|
||||||
if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0'
|
if (mapheaderinfo[gamemap-1]->forcecharacter[0] != '\0')
|
||||||
&& atoi(mapheaderinfo[gamemap-1]->forcecharacter) != 255)
|
|
||||||
P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter);
|
P_ForceCharacter(mapheaderinfo[gamemap-1]->forcecharacter);
|
||||||
|
|
||||||
// chasecam on in chaos, race, coop
|
// chasecam on in chaos, race, coop
|
||||||
|
|
@ -3041,6 +3040,10 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// init gravity, tag lists,
|
||||||
|
// anything that P_ResetDynamicSlopes/P_LoadThings needs to know
|
||||||
|
P_InitSpecials();
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
P_ResetDynamicSlopes();
|
P_ResetDynamicSlopes();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -3059,8 +3062,6 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
if (loadprecip) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame)
|
if (loadprecip) // ugly hack for P_NetUnArchiveMisc (and P_LoadNetGame)
|
||||||
P_SpawnPrecipitation();
|
P_SpawnPrecipitation();
|
||||||
|
|
||||||
globalweather = mapheaderinfo[gamemap-1]->weather;
|
|
||||||
|
|
||||||
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
#ifdef HWRENDER // not win32 only 19990829 by Kin
|
||||||
if (rendermode != render_soft && rendermode != render_none)
|
if (rendermode != render_soft && rendermode != render_none)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
62
src/p_spec.c
62
src/p_spec.c
|
|
@ -5621,6 +5621,45 @@ static void P_RunLevelLoadExecutors(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Before things are loaded, initialises certain stuff in case they're needed
|
||||||
|
* by P_ResetDynamicSlopes or P_LoadThings. This was split off from
|
||||||
|
* P_SpawnSpecials, in case you couldn't tell.
|
||||||
|
*
|
||||||
|
* \sa P_SpawnSpecials, P_InitTagLists
|
||||||
|
* \author Monster Iestyn
|
||||||
|
*/
|
||||||
|
void P_InitSpecials(void)
|
||||||
|
{
|
||||||
|
// Set the default gravity. Custom gravity overrides this setting.
|
||||||
|
gravity = (FRACUNIT*8)/10;
|
||||||
|
|
||||||
|
// Defaults in case levels don't have them set.
|
||||||
|
sstimer = 90*TICRATE + 6;
|
||||||
|
totalrings = 1;
|
||||||
|
|
||||||
|
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
|
||||||
|
|
||||||
|
// Set curWeather
|
||||||
|
switch (mapheaderinfo[gamemap-1]->weather)
|
||||||
|
{
|
||||||
|
case PRECIP_SNOW: // snow
|
||||||
|
case PRECIP_RAIN: // rain
|
||||||
|
case PRECIP_STORM: // storm
|
||||||
|
case PRECIP_STORM_NORAIN: // storm w/o rain
|
||||||
|
case PRECIP_STORM_NOSTRIKES: // storm w/o lightning
|
||||||
|
curWeather = mapheaderinfo[gamemap-1]->weather;
|
||||||
|
break;
|
||||||
|
default: // blank/none
|
||||||
|
curWeather = PRECIP_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set globalweather
|
||||||
|
globalweather = mapheaderinfo[gamemap-1]->weather;
|
||||||
|
|
||||||
|
P_InitTagLists(); // Create xref tables for tags
|
||||||
|
}
|
||||||
|
|
||||||
/** After the map has loaded, scans for specials that spawn 3Dfloors and
|
/** After the map has loaded, scans for specials that spawn 3Dfloors and
|
||||||
* thinkers.
|
* thinkers.
|
||||||
*
|
*
|
||||||
|
|
@ -5642,15 +5681,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
// but currently isn't.
|
// but currently isn't.
|
||||||
(void)fromnetsave;
|
(void)fromnetsave;
|
||||||
|
|
||||||
// Set the default gravity. Custom gravity overrides this setting.
|
|
||||||
gravity = (FRACUNIT*8)/10;
|
|
||||||
|
|
||||||
// Defaults in case levels don't have them set.
|
|
||||||
sstimer = 90*TICRATE + 6;
|
|
||||||
totalrings = 1;
|
|
||||||
|
|
||||||
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
|
|
||||||
|
|
||||||
// Init special SECTORs.
|
// Init special SECTORs.
|
||||||
sector = sectors;
|
sector = sectors;
|
||||||
for (i = 0; i < numsectors; i++, sector++)
|
for (i = 0; i < numsectors; i++, sector++)
|
||||||
|
|
@ -5699,20 +5729,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapheaderinfo[gamemap-1]->weather == 2) // snow
|
|
||||||
curWeather = PRECIP_SNOW;
|
|
||||||
else if (mapheaderinfo[gamemap-1]->weather == 3) // rain
|
|
||||||
curWeather = PRECIP_RAIN;
|
|
||||||
else if (mapheaderinfo[gamemap-1]->weather == 1) // storm
|
|
||||||
curWeather = PRECIP_STORM;
|
|
||||||
else if (mapheaderinfo[gamemap-1]->weather == 5) // storm w/o rain
|
|
||||||
curWeather = PRECIP_STORM_NORAIN;
|
|
||||||
else if (mapheaderinfo[gamemap-1]->weather == 6) // storm w/o lightning
|
|
||||||
curWeather = PRECIP_STORM_NOSTRIKES;
|
|
||||||
else
|
|
||||||
curWeather = PRECIP_NONE;
|
|
||||||
|
|
||||||
P_InitTagLists(); // Create xref tables for tags
|
|
||||||
P_SearchForDisableLinedefs(); // Disable linedefs are now allowed to disable *any* line
|
P_SearchForDisableLinedefs(); // Disable linedefs are now allowed to disable *any* line
|
||||||
|
|
||||||
P_SpawnScrollers(); // Add generalized scrollers
|
P_SpawnScrollers(); // Add generalized scrollers
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ void P_InitPicAnims(void);
|
||||||
void P_SetupLevelFlatAnims(void);
|
void P_SetupLevelFlatAnims(void);
|
||||||
|
|
||||||
// at map load
|
// at map load
|
||||||
|
void P_InitSpecials(void);
|
||||||
void P_SpawnSpecials(INT32 fromnetsave);
|
void P_SpawnSpecials(INT32 fromnetsave);
|
||||||
|
|
||||||
// every tic
|
// every tic
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue