mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge branch 'fix-faulty-references-false-positive' into 'master'
Fix false positive P_RemoveThinkerDelayed warning See merge request KartKrew/Kart!1087
This commit is contained in:
		
						commit
						2547ba6d6b
					
				
					 1 changed files with 9 additions and 7 deletions
				
			
		
							
								
								
									
										16
									
								
								src/p_tick.c
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								src/p_tick.c
									
										
									
									
									
								
							| 
						 | 
					@ -300,17 +300,19 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
 | 
				
			||||||
	if (thinker->references != 0)
 | 
						if (thinker->references != 0)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
#ifdef PARANOIA
 | 
					#ifdef PARANOIA
 | 
				
			||||||
		if (thinker->debug_time > leveltime)
 | 
					 | 
				
			||||||
		{
 | 
					 | 
				
			||||||
			thinker->debug_time = leveltime + 2; // do not print errors again
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		// Removed mobjs can be the target of another mobj. In
 | 
							// Removed mobjs can be the target of another mobj. In
 | 
				
			||||||
		// that case, the other mobj will manage its reference
 | 
							// that case, the other mobj will manage its reference
 | 
				
			||||||
		// to the removed mobj in P_MobjThinker. However, if
 | 
							// to the removed mobj in P_MobjThinker. However, if
 | 
				
			||||||
		// the removed mobj is removed after the other object
 | 
							// the removed mobj is removed after the other object
 | 
				
			||||||
		// thinks, the reference management is delayed by one
 | 
							// thinks, the reference management is delayed by one
 | 
				
			||||||
		// tic.
 | 
							// tic (or two?)
 | 
				
			||||||
		else if (thinker->debug_time < leveltime)
 | 
							const UINT8 delay = 2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (thinker->debug_time > leveltime)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								thinker->debug_time = leveltime + delay + 1; // do not print errors again
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else if ((thinker->debug_time + delay) <= leveltime)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			CONS_Printf(
 | 
								CONS_Printf(
 | 
				
			||||||
					"PARANOIA/P_RemoveThinkerDelayed: %p %s references=%d\n",
 | 
										"PARANOIA/P_RemoveThinkerDelayed: %p %s references=%d\n",
 | 
				
			||||||
| 
						 | 
					@ -319,7 +321,7 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
 | 
				
			||||||
					thinker->references
 | 
										thinker->references
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			thinker->debug_time = leveltime + 2; // do not print this error again
 | 
								thinker->debug_time = leveltime + delay + 1; // do not print this error again
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue