<commit_before>﻿// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
/***********************************************************************************
**
** GumpManager.cpp
**
** Copyright (C) August 2016 Hotride
**
************************************************************************************
*/
//----------------------------------------------------------------------------------
#include "stdafx.h"
//----------------------------------------------------------------------------------
CGumpManager g_GumpManager;
//----------------------------------------------------------------------------------
/*!
Вычислить количество статусбаров без пати
@return Количество non-party статусбыров
*/
int CGumpManager::GetNonpartyStatusbarsCount()
{
	WISPFUN_DEBUG("c144_f1");
	int count = 0;

	QFOR(gump, m_Items, CGump*)
	{
		if (gump->GumpType == GT_STATUSBAR && gump->Serial != g_PlayerSerial && !g_Party.Contains(gump->Serial))
			count++;
	}

	return count;
}
//----------------------------------------------------------------------------------
/*!
Добавить гамп
@param [__in] obj Ссылка на гамп
@return 
*/
void CGumpManager::AddGump(CGump *obj)
{
	WISPFUN_DEBUG("c144_f2");
	if (m_Items == NULL)
	{
		m_Items = obj;
		obj->m_Next = NULL;
		obj->m_Prev = NULL;
	}
	else
	{
		bool canCheck = (obj->GumpType != GT_GENERIC && obj->GumpType != GT_MENU && obj->GumpType != GT_TRADE && obj->GumpType != GT_BULLETIN_BOARD_ITEM);

		QFOR(gump, m_Items, CGump*)
		{
			GUMP_TYPE gumpType = gump->GumpType;

			if (gumpType == obj->GumpType && canCheck)
			{
				if (gump->Serial == obj->Serial)
				{
					if (gump->CanBeMoved())
					{
						if (gumpType == GT_DRAG || gumpType == GT_ABILITY || gumpType == GT_RACIAL_ABILITY)
						{
							gump->X = obj->X;
							gump->Y = obj->Y;
						}
						else if (gumpType == GT_STATUSBAR)
						{
							CGumpStatusbar *sb = (CGumpStatusbar*)gump;

							int gx = obj->X;
							int gy = obj->Y;
						
							if (obj->Minimized)
							{
								gx = obj->MinimizedX;
								gy = obj->MinimizedY;
							}
						
							if (sb->InGroup())
								sb->UpdateGroup(-(gump->MinimizedX - gx), -(gump->MinimizedY - gy));

							if (gump->Minimized)
							{
								gump->MinimizedX = gx;
								gump->MinimizedY = gy;
							}
							else
							{
								gump->X = gx;
								gump->Y = gy;
							}
						}
						else if (gumpType == GT_SPELL)
						{
							CGumpSpell *spell = (CGumpSpell*)gump;

							int gx = obj->X;
							int gy = obj->Y;

							if (spell->InGroup())
								spell->UpdateGroup(-(gump->X - gx), -(gump->Y - gy));

							gump->X = gx;
							gump->Y = gy;
						}
					}

					obj->m_Next = NULL;
					delete obj;

					if (gumpType == GT_WORLD_MAP && !((CGumpWorldMap*)gump)->Called)
						((CGumpWorldMap*)gump)->Called = true;
					else if (gump->GumpType == GT_POPUP_MENU)
						g_PopupMenu = (CGumpPopupMenu*)gump;
					else if (gumpType == GT_CONTAINER || gumpType == GT_JOURNAL || gumpType == GT_SKILLS)
					{
						gump->Minimized = false;
						gump->Page = 2;
					}
					else if (gumpType == GT_MINIMAP)
					{
						gump->Minimized = !gump->Minimized;
						((CGumpMinimap*)gump)->LastX = 0;
					}
					else if (gumpType == GT_SPELLBOOK && gump->Minimized)
					{
						gump->Minimized = false;
						gump->WantUpdateContent = true;
					}

					MoveToBack(gump);

					gump->FrameCreated = false;

					return;
				}
			}

			if (gump->m_Next == NULL)
			{
				gump->m_Next = obj;
				obj->m_Prev = gump;
				obj->m_Next = NULL;

				break;
			}
		}
	}

	if (obj->GumpType == GT_STATUSBAR && !g_Party.Contains(obj->Serial) && GetNonpartyStatusbarsCount() > 10)
	{
		//RemoveGump(obj);

		QFOR(gump, m_Items, CGump*)
		{
			if (gump->GumpType == GT_STATUSBAR && gump->Serial != g_PlayerSerial && !g_Party.Contains(gump->Serial))
			{
				RemoveGump(gump);

				g_Orion.CreateTextMessage(TT_SYSTEM, 0xFFFFFFFF, 3, 0, "You have too many non-party status bars");

				break;
			}
		}

		obj->PrepareTextures();
	}
	else
	{
		switch (obj->GumpType)
		{
			case GT_CONTAINER:
			{
				ushort sound = g_ContainerOffset[obj->Graphic].OpenSound;

				if (sound)
					g_Orion.PlaySoundEffect(sound);

				break;
			}
			case GT_SPELLBOOK:
			{
				//UO->PlaySoundEffect(0x????);
				break;
			}
			case GT_SKILLS:
			{
				((CGumpSkills*)obj)->Init();
				break;
			}
			case GT_OPTIONS:
			{
				((CGumpOptions*)obj)->Init();
				break;
			}
			case GT_WORLD_MAP:
			{
				if (g_ConfigManager.UseGlobalMapLayer)
					MoveToFront(obj);

				break;
			}
			default:
				break;
		}

		obj->PrepareTextures();
	}
}
//----------------------------------------------------------------------------------
/*!
Получить гамп-владелец текущей активной TEntryText
@return Ссылку на гамп или NULL
*/
CGump *CGumpManager::GetTextEntryOwner()
{
	WISPFUN_DEBUG("c144_f3");
	QFOR(gump, m_Items, CGump*)
	{
		if (gump->EntryPointerHere())
			return gump;
	}

	return NULL;
}
//----------------------------------------------------------------------------------
/*!
Проверить, существует ли гамп
@param [__in] gumpID ID гампа (в памяти)
@return
*/
CGump *CGumpManager::GumpExists(uint gumpID)
{
	WISPFUN_DEBUG("c144_f4");
	QFOR(gump, m_Items, CGump*)
	{
		if (gumpID == (uint)gump)
			return gump;
	}

	return NULL;
}
//----------------------------------------------------------------------------------
/*!
Обновить содержимое гампа
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return Ссылку на обновленный гамп или NULL
*/
CGump *CGumpManager::UpdateContent(const uint &serial, const uint &id, const GUMP_TYPE &type)
{
	WISPFUN_DEBUG("c144_f5");
	CGump *gump = GetGump(serial, id, type);

	if (gump != NULL)
		gump->WantUpdateContent = true;

	return gump;
}
//----------------------------------------------------------------------------------
/*!
Обновить гамп
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return Ссылку на обновленный гамп или NULL
*/
CGump *CGumpManager::UpdateGump(const uint &serial, const uint &id, const GUMP_TYPE &type)
{
	WISPFUN_DEBUG("c144_f6");
	CGump *gump = GetGump(serial, id, type);

	if (gump != NULL)
		gump->WantRedraw = true;

	return gump;
}
//----------------------------------------------------------------------------------
/*!
Найти гамп
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return Ссылку на гамп или NULL
*/
CGump *CGumpManager::GetGump(const uint &serial, const uint &id, const GUMP_TYPE &type)
{
	WISPFUN_DEBUG("c144_f7");
	CGump *gump = (CGump*)m_Items;

	while (gump != NULL)
	{
		if (gump->GumpType == type)
		{
			if (type == GT_SHOP || type == GT_TARGET_SYSTEM || type == GT_CUSTOM_HOUSE)
				break;
			else if (type == GT_TRADE)
			{
				if (gump->Serial == serial)
					break;
				else if (!serial && (gump->ID == id || ((CGumpSecureTrading*)gump)->ID2 == id))
					break;
			}
			else if (gump->Serial == serial)
			{
				if (type == GT_CONTAINER || type == GT_SPELLBOOK || type == GT_BULLETIN_BOARD_ITEM)
					break;
				else if (gump->ID == id)
					break;
			}
		}

		gump = (CGump*)gump->m_Next;
	}

	return gump;
}
//----------------------------------------------------------------------------------
/*!
Закрыть все гампы с указанными параметрами
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return
*/
void CGumpManager::CloseGump(uint serial, uint id, GUMP_TYPE type)
{
	WISPFUN_DEBUG("c144_f8");
	for (CGump *gump = (CGump*)m_Items; gump != NULL; )
	{
		CGump *next = (CGump*)gump->m_Next;

		if (gump->GumpType == type)
		{
			if (type == GT_TARGET_SYSTEM)
				RemoveGump(gump);
			else if (type == GT_GENERIC && gump->Serial == serial && gump->ID == id)
				RemoveGump(gump);
			else if (type == GT_TRADE && gump->ID == serial)
				RemoveGump(gump);
			else if (type == GT_BULLETIN_BOARD_ITEM && gump->ID == id)
			{
				if (serial == 0xFFFFFFFF || gump->Serial == serial)
					RemoveGump(gump);
			}
			else if (type == GT_SHOP || type == GT_SPELLBOOK || type == GT_DRAG)
			{
				if (serial)
				{
					if (serial == gump->Serial)
						RemoveGump(gump);
				}
				else
					RemoveGump(gump);
			}
			else if (gump->Serial == serial)
				RemoveGump(gump);
		}

		gump = next;
	}
}
//----------------------------------------------------------------------------------
/*!
Удалить гамп
@param [__in] obj Ссылка на гамп
@return
*/
void CGumpManager::RemoveGump(CGump *obj)
{
	WISPFUN_DEBUG("c144_f8");
	Unlink(obj);

	if (g_World != NULL)
	{
		CGameItem *selobj = g_World->FindWorldItem(obj->Serial);

		if (selobj != NULL)
		{
			selobj->Dragged = false;
			selobj->Opened = false;
		}
	}

	if (obj->GumpType == GT_CONTAINER && obj->Graphic > 0 && obj->Graphic < g_ContainerOffset.size())
	{
		ushort sound = g_ContainerOffset[obj->Graphic].CloseSound;

		if (sound)
			g_Orion.PlaySoundEffect(sound);
	}

	obj->m_Next = NULL;
	obj->m_Prev = NULL;
	delete obj;
}
//----------------------------------------------------------------------------------
/*!
Событие удаления менеджера (вызывается перед удалением)
@return 
*/
void CGumpManager::OnDelete()
{
	WISPFUN_DEBUG("c144_f10");
	CGump *gump = (CGump*)m_Items;

	while (gump != NULL)
	{
		CGump *tmp = (CGump*)gump->m_Next;

		if (gump->GumpType == GT_STATUSBAR)
			RemoveGump(gump);

		gump = tmp;
	}
}
//----------------------------------------------------------------------------------
/*!
Удалить гампы, которые не могут быть досягаемы из-за изменения дистанции до объекта
@return 
*/
void CGumpManager::RemoveRangedGumps()
{
	WISPFUN_DEBUG("c144_f11");
	if (g_World != NULL)
	{
		CGump *gump = (CGump*)m_Items;

		while (gump != NULL)
		{
			CGump *tmp = (CGump*)gump->m_Next;

			switch (gump->GumpType)
			{
				//case GT_STATUSBAR:
				case GT_PAPERDOLL:
				case GT_MAP:
				case GT_SPELLBOOK:
				case GT_DRAG:
				case GT_TRADE:
				case GT_SHOP:
				{
					if (g_World->FindWorldObject(gump->Serial) == NULL)
						RemoveGump(gump); //Или CloseGump() ?
					break;
				}
				case GT_CONTAINER:
				{
					if (GetTopObjDistance(g_Player, g_World->FindWorldObject(gump->Serial)) > REMOVE_CONTAINER_GUMP_RANGE)
						RemoveGump(gump);
					break;
				}
				default:
					break;
			}

			gump = tmp;
		}
	}
}
//----------------------------------------------------------------------------------
void CGumpManager::PrepareContent()
{<commit_msg>Trade and shop gumps closing range check<commit_after>﻿// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
/***********************************************************************************
**
** GumpManager.cpp
**
** Copyright (C) August 2016 Hotride
**
************************************************************************************
*/
//----------------------------------------------------------------------------------
#include "stdafx.h"
//----------------------------------------------------------------------------------
CGumpManager g_GumpManager;
//----------------------------------------------------------------------------------
/*!
Вычислить количество статусбаров без пати
@return Количество non-party статусбыров
*/
int CGumpManager::GetNonpartyStatusbarsCount()
{
	WISPFUN_DEBUG("c144_f1");
	int count = 0;

	QFOR(gump, m_Items, CGump*)
	{
		if (gump->GumpType == GT_STATUSBAR && gump->Serial != g_PlayerSerial && !g_Party.Contains(gump->Serial))
			count++;
	}

	return count;
}
//----------------------------------------------------------------------------------
/*!
Добавить гамп
@param [__in] obj Ссылка на гамп
@return 
*/
void CGumpManager::AddGump(CGump *obj)
{
	WISPFUN_DEBUG("c144_f2");
	if (m_Items == NULL)
	{
		m_Items = obj;
		obj->m_Next = NULL;
		obj->m_Prev = NULL;
	}
	else
	{
		bool canCheck = (obj->GumpType != GT_GENERIC && obj->GumpType != GT_MENU && obj->GumpType != GT_TRADE && obj->GumpType != GT_BULLETIN_BOARD_ITEM);

		QFOR(gump, m_Items, CGump*)
		{
			GUMP_TYPE gumpType = gump->GumpType;

			if (gumpType == obj->GumpType && canCheck)
			{
				if (gump->Serial == obj->Serial)
				{
					if (gump->CanBeMoved())
					{
						if (gumpType == GT_DRAG || gumpType == GT_ABILITY || gumpType == GT_RACIAL_ABILITY)
						{
							gump->X = obj->X;
							gump->Y = obj->Y;
						}
						else if (gumpType == GT_STATUSBAR)
						{
							CGumpStatusbar *sb = (CGumpStatusbar*)gump;

							int gx = obj->X;
							int gy = obj->Y;
						
							if (obj->Minimized)
							{
								gx = obj->MinimizedX;
								gy = obj->MinimizedY;
							}
						
							if (sb->InGroup())
								sb->UpdateGroup(-(gump->MinimizedX - gx), -(gump->MinimizedY - gy));

							if (gump->Minimized)
							{
								gump->MinimizedX = gx;
								gump->MinimizedY = gy;
							}
							else
							{
								gump->X = gx;
								gump->Y = gy;
							}
						}
						else if (gumpType == GT_SPELL)
						{
							CGumpSpell *spell = (CGumpSpell*)gump;

							int gx = obj->X;
							int gy = obj->Y;

							if (spell->InGroup())
								spell->UpdateGroup(-(gump->X - gx), -(gump->Y - gy));

							gump->X = gx;
							gump->Y = gy;
						}
					}

					obj->m_Next = NULL;
					delete obj;

					if (gumpType == GT_WORLD_MAP && !((CGumpWorldMap*)gump)->Called)
						((CGumpWorldMap*)gump)->Called = true;
					else if (gump->GumpType == GT_POPUP_MENU)
						g_PopupMenu = (CGumpPopupMenu*)gump;
					else if (gumpType == GT_CONTAINER || gumpType == GT_JOURNAL || gumpType == GT_SKILLS)
					{
						gump->Minimized = false;
						gump->Page = 2;
					}
					else if (gumpType == GT_MINIMAP)
					{
						gump->Minimized = !gump->Minimized;
						((CGumpMinimap*)gump)->LastX = 0;
					}
					else if (gumpType == GT_SPELLBOOK && gump->Minimized)
					{
						gump->Minimized = false;
						gump->WantUpdateContent = true;
					}

					MoveToBack(gump);

					gump->FrameCreated = false;

					return;
				}
			}

			if (gump->m_Next == NULL)
			{
				gump->m_Next = obj;
				obj->m_Prev = gump;
				obj->m_Next = NULL;

				break;
			}
		}
	}

	if (obj->GumpType == GT_STATUSBAR && !g_Party.Contains(obj->Serial) && GetNonpartyStatusbarsCount() > 10)
	{
		//RemoveGump(obj);

		QFOR(gump, m_Items, CGump*)
		{
			if (gump->GumpType == GT_STATUSBAR && gump->Serial != g_PlayerSerial && !g_Party.Contains(gump->Serial))
			{
				RemoveGump(gump);

				g_Orion.CreateTextMessage(TT_SYSTEM, 0xFFFFFFFF, 3, 0, "You have too many non-party status bars");

				break;
			}
		}

		obj->PrepareTextures();
	}
	else
	{
		switch (obj->GumpType)
		{
			case GT_CONTAINER:
			{
				ushort sound = g_ContainerOffset[obj->Graphic].OpenSound;

				if (sound)
					g_Orion.PlaySoundEffect(sound);

				break;
			}
			case GT_SPELLBOOK:
			{
				//UO->PlaySoundEffect(0x????);
				break;
			}
			case GT_SKILLS:
			{
				((CGumpSkills*)obj)->Init();
				break;
			}
			case GT_OPTIONS:
			{
				((CGumpOptions*)obj)->Init();
				break;
			}
			case GT_WORLD_MAP:
			{
				if (g_ConfigManager.UseGlobalMapLayer)
					MoveToFront(obj);

				break;
			}
			default:
				break;
		}

		obj->PrepareTextures();
	}
}
//----------------------------------------------------------------------------------
/*!
Получить гамп-владелец текущей активной TEntryText
@return Ссылку на гамп или NULL
*/
CGump *CGumpManager::GetTextEntryOwner()
{
	WISPFUN_DEBUG("c144_f3");
	QFOR(gump, m_Items, CGump*)
	{
		if (gump->EntryPointerHere())
			return gump;
	}

	return NULL;
}
//----------------------------------------------------------------------------------
/*!
Проверить, существует ли гамп
@param [__in] gumpID ID гампа (в памяти)
@return
*/
CGump *CGumpManager::GumpExists(uint gumpID)
{
	WISPFUN_DEBUG("c144_f4");
	QFOR(gump, m_Items, CGump*)
	{
		if (gumpID == (uint)gump)
			return gump;
	}

	return NULL;
}
//----------------------------------------------------------------------------------
/*!
Обновить содержимое гампа
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return Ссылку на обновленный гамп или NULL
*/
CGump *CGumpManager::UpdateContent(const uint &serial, const uint &id, const GUMP_TYPE &type)
{
	WISPFUN_DEBUG("c144_f5");
	CGump *gump = GetGump(serial, id, type);

	if (gump != NULL)
		gump->WantUpdateContent = true;

	return gump;
}
//----------------------------------------------------------------------------------
/*!
Обновить гамп
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return Ссылку на обновленный гамп или NULL
*/
CGump *CGumpManager::UpdateGump(const uint &serial, const uint &id, const GUMP_TYPE &type)
{
	WISPFUN_DEBUG("c144_f6");
	CGump *gump = GetGump(serial, id, type);

	if (gump != NULL)
		gump->WantRedraw = true;

	return gump;
}
//----------------------------------------------------------------------------------
/*!
Найти гамп
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return Ссылку на гамп или NULL
*/
CGump *CGumpManager::GetGump(const uint &serial, const uint &id, const GUMP_TYPE &type)
{
	WISPFUN_DEBUG("c144_f7");
	CGump *gump = (CGump*)m_Items;

	while (gump != NULL)
	{
		if (gump->GumpType == type)
		{
			if (type == GT_SHOP || type == GT_TARGET_SYSTEM || type == GT_CUSTOM_HOUSE)
				break;
			else if (type == GT_TRADE)
			{
				if (gump->Serial == serial)
					break;
				else if (!serial && (gump->ID == id || ((CGumpSecureTrading*)gump)->ID2 == id))
					break;
			}
			else if (gump->Serial == serial)
			{
				if (type == GT_CONTAINER || type == GT_SPELLBOOK || type == GT_BULLETIN_BOARD_ITEM)
					break;
				else if (gump->ID == id)
					break;
			}
		}

		gump = (CGump*)gump->m_Next;
	}

	return gump;
}
//----------------------------------------------------------------------------------
/*!
Закрыть все гампы с указанными параметрами
@param [__in] serial Серийник гампа
@param [__in] ID ID гампа
@param [__in] Type Тип гампа
@return
*/
void CGumpManager::CloseGump(uint serial, uint id, GUMP_TYPE type)
{
	WISPFUN_DEBUG("c144_f8");
	for (CGump *gump = (CGump*)m_Items; gump != NULL; )
	{
		CGump *next = (CGump*)gump->m_Next;

		if (gump->GumpType == type)
		{
			if (type == GT_TARGET_SYSTEM)
				RemoveGump(gump);
			else if (type == GT_GENERIC && gump->Serial == serial && gump->ID == id)
				RemoveGump(gump);
			else if (type == GT_TRADE && gump->ID == serial)
				RemoveGump(gump);
			else if (type == GT_BULLETIN_BOARD_ITEM && gump->ID == id)
			{
				if (serial == 0xFFFFFFFF || gump->Serial == serial)
					RemoveGump(gump);
			}
			else if (type == GT_SHOP || type == GT_SPELLBOOK || type == GT_DRAG)
			{
				if (serial)
				{
					if (serial == gump->Serial)
						RemoveGump(gump);
				}
				else
					RemoveGump(gump);
			}
			else if (gump->Serial == serial)
				RemoveGump(gump);
		}

		gump = next;
	}
}
//----------------------------------------------------------------------------------
/*!
Удалить гамп
@param [__in] obj Ссылка на гамп
@return
*/
void CGumpManager::RemoveGump(CGump *obj)
{
	WISPFUN_DEBUG("c144_f8");
	Unlink(obj);

	if (g_World != NULL)
	{
		CGameItem *selobj = g_World->FindWorldItem(obj->Serial);

		if (selobj != NULL)
		{
			selobj->Dragged = false;
			selobj->Opened = false;
		}
	}

	if (obj->GumpType == GT_CONTAINER && obj->Graphic > 0 && obj->Graphic < g_ContainerOffset.size())
	{
		ushort sound = g_ContainerOffset[obj->Graphic].CloseSound;

		if (sound)
			g_Orion.PlaySoundEffect(sound);
	}

	obj->m_Next = NULL;
	obj->m_Prev = NULL;
	delete obj;
}
//----------------------------------------------------------------------------------
/*!
Событие удаления менеджера (вызывается перед удалением)
@return 
*/
void CGumpManager::OnDelete()
{
	WISPFUN_DEBUG("c144_f10");
	CGump *gump = (CGump*)m_Items;

	while (gump != NULL)
	{
		CGump *tmp = (CGump*)gump->m_Next;

		if (gump->GumpType == GT_STATUSBAR)
			RemoveGump(gump);

		gump = tmp;
	}
}
//----------------------------------------------------------------------------------
/*!
Удалить гампы, которые не могут быть досягаемы из-за изменения дистанции до объекта
@return 
*/
void CGumpManager::RemoveRangedGumps()
{
	WISPFUN_DEBUG("c144_f11");
	if (g_World != NULL)
	{
		CGump *gump = (CGump*)m_Items;

		while (gump != NULL)
		{
			CGump *tmp = (CGump*)gump->m_Next;

			switch (gump->GumpType)
			{
				//case GT_STATUSBAR:
				case GT_PAPERDOLL:
				case GT_MAP:
				case GT_SPELLBOOK:
				case GT_DRAG:						
				{
					if (g_World->FindWorldObject(gump->Serial) == NULL)
						RemoveGump(gump); //Или CloseGump() ?
					break;
				}
				case GT_TRADE:
				case GT_SHOP:
				{
					if (GetTopObjDistance(g_Player, g_World->FindWorldObject(gump->Serial)) > MAX_VIEW_RANGE_OLD)
						RemoveGump(gump);
					break;
				}
				case GT_CONTAINER:
				{
					if (GetTopObjDistance(g_Player, g_World->FindWorldObject(gump->Serial)) > REMOVE_CONTAINER_GUMP_RANGE)
						RemoveGump(gump);
					break;
				}
				default:
					break;
			}

			gump = tmp;
		}
	}
}
//----------------------------------------------------------------------------------
void CGumpManager::PrepareContent()
{
{'fraction_non_alphanumeric': 0.2567847719562759, 'fraction_numerical': 0.00603090840557859, 'mean_word_length': 1.9978813559322033, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 224, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5903589', 'n_tokens_mistral': 9382, 'n_tokens_neox': 7790, 'n_words': 1542}