Only AddFrameAction once.
This commit is contained in:
		
							parent
							
								
									c95724a9ac
								
							
						
					
					
						commit
						98fcde86c1
					
				@ -75,13 +75,19 @@ void DHooksEntityListener::OnEntityDestroyed(CBaseEntity *pEntity)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						bool bDeleting = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for(int i = g_pHooks.size() -1; i >= 0; i--)
 | 
						for(int i = g_pHooks.size() -1; i >= 0; i--)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		DHooksManager *manager = g_pHooks.at(i);
 | 
							DHooksManager *manager = g_pHooks.at(i);
 | 
				
			||||||
		if(manager->callback->entity == entity)
 | 
							if(manager->callback->entity == entity)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			manager->bDelete = true;
 | 
								manager->bDelete = true;
 | 
				
			||||||
 | 
								if (!bDeleting)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
				smutils->AddFrameAction(&FrameCleanupHooks, NULL);
 | 
									smutils->AddFrameAction(&FrameCleanupHooks, NULL);
 | 
				
			||||||
 | 
									bDeleting = true;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user