mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Fix slope spawning; let polyobjects spawn again
Move P_SpawnMapThings before P_SpawnSpecialsThatRequireObjects. Do not remove special from lines with ML_NETONLY or ML_NONET until after slopes are spawned.
This commit is contained in:
		
							parent
							
								
									285ec3e08c
								
							
						
					
					
						commit
						3cad7398f0
					
				
					 3 changed files with 55 additions and 38 deletions
				
			
		| 
						 | 
				
			
			@ -3986,11 +3986,12 @@ boolean P_LoadLevel(boolean fromnetsave)
 | 
			
		|||
 | 
			
		||||
	P_SpawnSlopes(fromnetsave);
 | 
			
		||||
 | 
			
		||||
	P_RaiseThings();
 | 
			
		||||
	P_SpawnSpecialsAfterSlopes();
 | 
			
		||||
 | 
			
		||||
	P_SpawnMapThings(!fromnetsave);
 | 
			
		||||
 | 
			
		||||
	P_SpawnSpecialsThatRequireObjects();
 | 
			
		||||
 | 
			
		||||
	P_SpawnMapThings(!fromnetsave);
 | 
			
		||||
	skyboxmo[0] = skyboxviewpnts[0];
 | 
			
		||||
	skyboxmo[1] = skyboxcenterpnts[0];
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										86
									
								
								src/p_spec.c
									
										
									
									
									
								
							
							
						
						
									
										86
									
								
								src/p_spec.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -5545,26 +5545,6 @@ P_RaiseTaggedThingsToFakeFloor (
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
P_RaiseThings (void)
 | 
			
		||||
{
 | 
			
		||||
	size_t i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < numlines; ++i)
 | 
			
		||||
	{
 | 
			
		||||
		switch (lines[i].special)
 | 
			
		||||
		{
 | 
			
		||||
			case 80: // Raise tagged things by type to this FOF
 | 
			
		||||
				P_RaiseTaggedThingsToFakeFloor(
 | 
			
		||||
						( sides[lines[i].sidenum[0]].textureoffset >> FRACBITS ),
 | 
			
		||||
						lines[i].tag,
 | 
			
		||||
						lines[i].frontsector
 | 
			
		||||
				);
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
// SPECIAL SPAWNING
 | 
			
		||||
//
 | 
			
		||||
| 
						 | 
				
			
			@ -5953,6 +5933,26 @@ static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flata
 | 
			
		|||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static boolean P_IsLineDisabled (const line_t * line)
 | 
			
		||||
{
 | 
			
		||||
	if (line->special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment in netgames...
 | 
			
		||||
	{
 | 
			
		||||
		if (netgame || multiplayer)
 | 
			
		||||
		{
 | 
			
		||||
			if (line->flags & ML_NONET)
 | 
			
		||||
			{
 | 
			
		||||
				return true;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		else if (line->flags & ML_NETONLY)
 | 
			
		||||
		{
 | 
			
		||||
			return true;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** After the map has loaded, scans for specials that spawn 3Dfloors and
 | 
			
		||||
  * thinkers.
 | 
			
		||||
  *
 | 
			
		||||
| 
						 | 
				
			
			@ -5973,6 +5973,8 @@ void P_SpawnSpecials(boolean fromnetsave)
 | 
			
		|||
	// but currently isn't.
 | 
			
		||||
	(void)fromnetsave;
 | 
			
		||||
 | 
			
		||||
	CONS_Printf("%d\n", sectors[11].floorheight);
 | 
			
		||||
 | 
			
		||||
	// yep, we do this here - "bossdisabled" is considered an apparatus of specials.
 | 
			
		||||
	bossdisabled = 0;
 | 
			
		||||
	stoppedclock = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -6070,22 +6072,9 @@ void P_SpawnSpecials(boolean fromnetsave)
 | 
			
		|||
	// Init line EFFECTs
 | 
			
		||||
	for (i = 0; i < numlines; i++)
 | 
			
		||||
	{
 | 
			
		||||
		if (lines[i].special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment in netgames...
 | 
			
		||||
		if (P_IsLineDisabled(&lines[i]))
 | 
			
		||||
		{
 | 
			
		||||
			// set line specials to 0 here too, same reason as above
 | 
			
		||||
			if (netgame || multiplayer)
 | 
			
		||||
			{
 | 
			
		||||
				if (lines[i].flags & ML_NONET)
 | 
			
		||||
				{
 | 
			
		||||
					lines[i].special = 0;
 | 
			
		||||
					continue;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			else if (lines[i].flags & ML_NETONLY)
 | 
			
		||||
			{
 | 
			
		||||
				lines[i].special = 0;
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch (lines[i].special)
 | 
			
		||||
| 
						 | 
				
			
			@ -6987,6 +6976,33 @@ void P_SpawnSpecialsThatRequireObjects(void)
 | 
			
		|||
	P_RunLevelLoadExecutors();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Fuck ML_NONET
 | 
			
		||||
  */
 | 
			
		||||
void P_SpawnSpecialsAfterSlopes(void)
 | 
			
		||||
{
 | 
			
		||||
	size_t i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < numlines; ++i)
 | 
			
		||||
	{
 | 
			
		||||
		if (P_IsLineDisabled(&lines[i]))
 | 
			
		||||
		{
 | 
			
		||||
			/* remove the special so it can't even be found during the level */
 | 
			
		||||
			lines[i].special = 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch (lines[i].special)
 | 
			
		||||
		{
 | 
			
		||||
			case 80: // Raise tagged things by type to this FOF
 | 
			
		||||
				P_RaiseTaggedThingsToFakeFloor(
 | 
			
		||||
						( sides[lines[i].sidenum[0]].textureoffset >> FRACBITS ),
 | 
			
		||||
						lines[i].tag,
 | 
			
		||||
						lines[i].frontsector
 | 
			
		||||
				);
 | 
			
		||||
				break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Adds 3Dfloors as appropriate based on a common control linedef.
 | 
			
		||||
  *
 | 
			
		||||
  * \param line        Control linedef to use.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@ void P_SetupLevelFlatAnims(void);
 | 
			
		|||
// at map load
 | 
			
		||||
void P_InitSpecials(void);
 | 
			
		||||
void P_SpawnSpecials(boolean fromnetsave);
 | 
			
		||||
void P_RaiseThings(void);
 | 
			
		||||
void P_SpawnSpecialsAfterSlopes(void);
 | 
			
		||||
void P_SpawnSpecialsThatRequireObjects(void);
 | 
			
		||||
 | 
			
		||||
// every tic
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue