mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'slope-stepup-fix' into 'master'
Fix slope stepup adjustment to not adjust on flat "slopes" See merge request KartKrew/Kart!2487
This commit is contained in:
		
						commit
						9c2e4a350a
					
				
					 1 changed files with 15 additions and 16 deletions
				
			
		
							
								
								
									
										31
									
								
								src/p_map.c
									
										
									
									
									
								
							
							
						
						
									
										31
									
								
								src/p_map.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2764,6 +2764,21 @@ fixed_t P_GetThingStepUp(mobj_t *thing, fixed_t destX, fixed_t destY)
 | 
			
		|||
		maxstep += maxstepmove;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (thing->standingslope && thing->standingslope->zdelta != 0)
 | 
			
		||||
	{
 | 
			
		||||
		vector3_t slopemom = {0,0,0};
 | 
			
		||||
		slopemom.x = thing->momx;
 | 
			
		||||
		slopemom.y = thing->momy;
 | 
			
		||||
		P_QuantizeMomentumToSlope(&slopemom, thing->standingslope);
 | 
			
		||||
		fixed_t momentumzdelta = FixedDiv(slopemom.z, FixedHypot(slopemom.x, slopemom.y)); // so this lets us know what the zdelta is for the vector the player is travelling along, in addition to the slope's zdelta in its xydirection
 | 
			
		||||
		// if (thing->player)
 | 
			
		||||
		// 	CONS_Printf("%s P_GetThingStepUp %d +", player_names[thing->player-players], maxstep);
 | 
			
		||||
		maxstep += abs(momentumzdelta);
 | 
			
		||||
		// if (thing->player)
 | 
			
		||||
		// 	CONS_Printf(" %d = %d\n", momentumzdelta, maxstep);
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (P_MobjTouchingSectorSpecialFlag(thing, SSF_DOUBLESTEPUP)
 | 
			
		||||
		|| (R_PointInSubsector(destX, destY)->sector->specialflags & SSF_DOUBLESTEPUP))
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			@ -2777,22 +2792,6 @@ fixed_t P_GetThingStepUp(mobj_t *thing, fixed_t destX, fixed_t destY)
 | 
			
		|||
		maxstep = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (thing->standingslope)
 | 
			
		||||
	{
 | 
			
		||||
		vector3_t slopemom = {0,0,0};
 | 
			
		||||
		slopemom.x = thing->momx;
 | 
			
		||||
		slopemom.y = thing->momy;
 | 
			
		||||
		slopemom.z = 0;
 | 
			
		||||
		P_QuantizeMomentumToSlope(&slopemom, thing->standingslope);
 | 
			
		||||
		fixed_t momentumzdelta = FixedDiv(slopemom.z, FixedHypot(slopemom.x, slopemom.y)); // so this lets us know what the zdelta is for the vector the player is travelling along, in addition to the slope's zdelta in its xydirection
 | 
			
		||||
		// if (thing->player)
 | 
			
		||||
		// 	CONS_Printf("%s P_GetThingStepUp %d +", player_names[thing->player-players], maxstep);
 | 
			
		||||
		maxstep += abs(momentumzdelta);
 | 
			
		||||
		// if (thing->player)
 | 
			
		||||
		// 	CONS_Printf(" %d = %d\n", momentumzdelta, maxstep);
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return maxstep;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue