2018-03-29 17:01:57 -04:00
2019-07-07 20:56:15 +00:00
# include <StdAfx.h>
2018-03-29 17:01:57 -04:00
# include "Vendor.h"
# include "WeenieFactory.h"
# include "World.h"
# include "Player.h"
# include "EmoteManager.h"
2018-10-27 22:13:32 -05:00
# include "SpellcastingManager.h"
2018-03-29 17:01:57 -04:00
CVendorItem : : CVendorItem ( )
{
}
CVendorItem : : ~ CVendorItem ( )
{
2018-07-12 14:41:21 -07:00
g_pWorld - > EnsureRemoved ( weenie ) ;
SafeDelete ( weenie ) ;
2018-03-29 17:01:57 -04:00
}
CVendor : : CVendor ( )
{
m_Qualities . m_WeenieType = Vendor_WeenieType ;
}
CVendor : : ~ CVendor ( )
{
ResetItems ( ) ;
}
2018-12-18 03:26:56 +00:00
void CVendor : : Tick ( )
{
if ( m_EmoteManager )
m_EmoteManager - > Tick ( ) ;
if ( m_VendorCycleTime < = Timer : : cur_time )
{
CheckRange ( ) ;
m_VendorCycleTime = ( Timer : : cur_time + 3 ) ;
}
}
2018-03-29 17:01:57 -04:00
void CVendor : : ResetItems ( )
{
2018-07-12 14:41:21 -07:00
for ( auto item : m_Items )
{
delete item ;
}
2018-03-29 17:01:57 -04:00
m_Items . clear ( ) ;
}
2019-07-07 20:56:15 +00:00
void CVendor : : AddVendorItem ( uint32_t wcid , int ptid , float shade , int amount )
2018-03-29 17:01:57 -04:00
{
2019-01-29 21:28:34 -08:00
if ( wcid = = 1 )
return ;
2018-07-12 14:41:21 -07:00
CWeenieObject * weenie = g_pWeenieFactory - > CreateWeenieByClassID ( wcid ) ;
2018-03-29 17:01:57 -04:00
if ( ! weenie )
return ;
2019-01-29 21:28:34 -08:00
2018-03-29 17:01:57 -04:00
if ( ptid )
weenie - > m_Qualities . SetInt ( PALETTE_TEMPLATE_INT , ptid ) ;
if ( shade > 0.0 )
weenie - > m_Qualities . SetFloat ( SHADE_FLOAT , shade ) ;
2019-11-13 20:57:17 +00:00
if ( ! g_pWorld - > CreateEntity ( weenie , false ) )
2018-03-29 17:01:57 -04:00
return ;
2018-07-12 14:41:21 -07:00
CVendorItem * item = new CVendorItem ( ) ;
2018-03-29 17:01:57 -04:00
item - > weenie = weenie ;
item - > amount = amount ;
m_Items . push_back ( item ) ;
}
2019-07-07 20:56:15 +00:00
void CVendor : : AddVendorItem ( uint32_t wcid , int amount )
2018-03-29 17:01:57 -04:00
{
2019-01-29 21:28:34 -08:00
if ( wcid = = 1 )
return ;
2018-07-12 14:41:21 -07:00
CWeenieObject * weenie = g_pWeenieFactory - > CreateWeenieByClassID ( wcid ) ;
2018-03-29 17:01:57 -04:00
if ( ! weenie )
return ;
2019-11-13 20:57:17 +00:00
if ( ! g_pWorld - > CreateEntity ( weenie , false ) )
2018-03-29 17:01:57 -04:00
return ;
2018-07-12 14:41:21 -07:00
CVendorItem * item = new CVendorItem ( ) ;
2018-03-29 17:01:57 -04:00
item - > weenie = weenie ;
item - > amount = amount ;
m_Items . push_back ( item ) ;
}
2019-07-07 20:56:15 +00:00
CVendorItem * CVendor : : FindVendorItem ( uint32_t item_id )
2018-03-29 17:01:57 -04:00
{
for ( auto item : m_Items )
{
2018-07-12 14:41:21 -07:00
if ( item - > weenie - > GetID ( ) = = item_id )
2018-03-29 17:01:57 -04:00
return item ;
}
return NULL ;
}
2018-07-12 14:41:21 -07:00
int CVendor : : TrySellItemsToPlayer ( CPlayerWeenie * buyer , const std : : list < ItemProfile * > & desiredItems )
2018-03-29 17:01:57 -04:00
{
2019-07-07 20:56:15 +00:00
const uint32_t MAX_COIN_PURCHASE = 2000000000 ; // // limit to purchases less than 2 billion pyreal
2018-03-29 17:01:57 -04:00
// using WERROR_NO_OBJECT as a generic error, change later if it matters
if ( desiredItems . size ( ) > = 100 )
return WERROR_NO_OBJECT ;
2018-08-08 19:51:43 -05:00
int currencyid = W_COINSTACK_CLASS ;
if ( profile . trade_id )
currencyid = profile . trade_id ;
2019-10-27 17:56:23 +00:00
int currencyamount = buyer - > RecalculateCoinAmount ( currencyid ) ;
2018-04-15 02:21:51 -05:00
2019-11-13 20:40:06 +00:00
// check cost of items: Pyreal, Slots, PackSlots
2018-03-29 17:01:57 -04:00
UINT64 totalCost = 0 ;
2019-07-07 20:56:15 +00:00
uint32_t totalSlotsRequired = 0 ;
2019-11-13 20:40:06 +00:00
uint32_t totalPackSlotsRequired = 0 ;
2018-03-29 17:01:57 -04:00
for ( auto desiredItem : desiredItems )
{
2018-07-12 14:41:21 -07:00
CVendorItem * vendorItem = FindVendorItem ( desiredItem - > iid ) ;
2018-03-29 17:01:57 -04:00
if ( ! vendorItem )
return WERROR_NO_OBJECT ;
if ( vendorItem - > amount > = 0 & & vendorItem - > amount < desiredItem - > amount )
return WERROR_NO_OBJECT ;
if ( desiredItem - > amount = = 0 )
continue ;
2018-07-12 14:41:21 -07:00
int maxStackSize = vendorItem - > weenie - > InqIntQuality ( MAX_STACK_SIZE_INT , 1 ) ;
2018-03-29 17:01:57 -04:00
if ( maxStackSize < 1 )
maxStackSize = 1 ;
2019-11-13 20:40:06 +00:00
if ( vendorItem - > weenie - > RequiresPackSlot ( ) )
{
totalPackSlotsRequired + + ;
}
else {
totalSlotsRequired + = ( desiredItem - > amount / maxStackSize ) ;
if ( desiredItem - > amount % maxStackSize > 0 )
totalSlotsRequired + + ;
}
2018-03-29 17:01:57 -04:00
2018-07-12 14:41:21 -07:00
if ( vendorItem - > weenie - > InqIntQuality ( ITEM_TYPE_INT , TYPE_UNDEF ) = = TYPE_PROMISSORY_NOTE )
2019-07-07 20:56:15 +00:00
totalCost + = ( uint32_t ) round ( ( vendorItem - > weenie - > GetValue ( ) * 1.15 ) * desiredItem - > amount ) ;
2018-03-29 17:01:57 -04:00
else
2019-07-07 20:56:15 +00:00
totalCost + = ( uint32_t ) round ( ( vendorItem - > weenie - > GetValue ( ) * profile . sell_price ) * desiredItem - > amount ) ;
2018-03-29 17:01:57 -04:00
}
if ( totalCost > = MAX_COIN_PURCHASE )
return WERROR_NO_OBJECT ; // limit to purchases less than 2 billion pyreal
2019-10-27 17:56:23 +00:00
if ( currencyamount < totalCost )
2018-04-15 02:21:51 -05:00
{
2018-03-29 17:01:57 -04:00
buyer - > SendText ( " You don't have enough money. " , LTT_DEFAULT ) ;
return WERROR_NO_OBJECT ;
}
if ( buyer - > Container_GetNumFreeMainPackSlots ( ) < totalSlotsRequired )
{
buyer - > SendText ( " There's not enough room for the items in your inventory. " , LTT_DEFAULT ) ;
return WERROR_NO_OBJECT ;
}
2019-11-13 20:40:06 +00:00
if ( ( buyer - > GetContainersCapacity ( ) - buyer - > m_Packs . size ( ) ) < totalPackSlotsRequired )
{
buyer - > SendText ( " There's not pack slots for the items in your inventory. " , LTT_DEFAULT ) ;
return WERROR_NO_OBJECT ;
}
2019-07-07 20:56:15 +00:00
uint32_t coinConsumed = 0 ;
2018-04-15 02:21:51 -05:00
2018-08-08 19:51:43 -05:00
coinConsumed = buyer - > ConsumeCoin ( totalCost , currencyid ) ;
2018-04-15 02:21:51 -05:00
2018-03-29 17:01:57 -04:00
if ( coinConsumed < totalCost )
{
//This shouldn't happen.
buyer - > SendText ( " Couldn't find all the money for the payment. " , LTT_DEFAULT ) ;
2018-08-08 19:51:43 -05:00
buyer - > SpawnInContainer ( currencyid , coinConsumed ) ; //give back what we consumed and abort.
2018-04-16 16:26:19 -05:00
2018-03-29 17:01:57 -04:00
return WERROR_NO_OBJECT ;
}
buyer - > EmitSound ( Sound_PickUpItem , 1.0f ) ;
// clone the weenie
for ( auto desiredItem : desiredItems )
{
2018-07-12 14:41:21 -07:00
CWeenieObject * originalWeenie = FindVendorItem ( desiredItem - > iid ) - > weenie ;
2018-10-27 22:13:32 -05:00
if ( originalWeenie - > m_Qualities . GetInt ( ITEM_TYPE_INT , 0 ) = = TYPE_SERVICE )
{
DoForcedMotion ( Motion_CastSpell ) ;
MakeSpellcastingManager ( ) - > CastSpellInstant ( buyer - > GetID ( ) , originalWeenie - > m_Qualities . GetDID ( SPELL_DID , 0 ) ) ;
DoForcedMotion ( Motion_Ready ) ;
}
else
2019-11-13 20:57:17 +00:00
{
originalWeenie - > SetID ( CWorld : : GenerateGUID ( eDynamicGUID ) ) ;
2018-10-27 22:13:32 -05:00
buyer - > SpawnCloneInContainer ( originalWeenie , desiredItem - > amount ) ;
2019-11-13 20:57:17 +00:00
}
2018-03-29 17:01:57 -04:00
}
DoVendorEmote ( Buy_VendorTypeEmote , buyer - > GetID ( ) ) ;
2019-10-27 17:56:23 +00:00
if ( profile . trade_id ) {
profile . trade_num = currencyamount ;
} else {
profile . trade_num = 0 ;
}
2018-08-08 19:51:43 -05:00
SendVendorInventory ( buyer ) ;
2018-03-29 17:01:57 -04:00
return WERROR_NONE ;
}
2018-07-12 14:41:21 -07:00
int CVendor : : TryBuyItemsFromPlayer ( CPlayerWeenie * seller , const std : : list < ItemProfile * > & desiredItems )
2018-03-29 17:01:57 -04:00
{
2019-07-07 20:56:15 +00:00
const uint32_t MAX_COIN_PURCHASE = 1000000000 ; // limit to purchases less than 1 billion pyreal
const uint32_t MAX_COIN_ALLOWED = 2000000000 ; // limit to max amount of coin to less than 2 billion pyreal
2018-03-29 17:01:57 -04:00
// using WERROR_NO_OBJECT as a generic error, change later if it matters
if ( desiredItems . size ( ) > = 100 )
return WERROR_NO_OBJECT ;
// check price of items
UINT64 totalValue = 0 ;
2019-01-07 06:00:21 +00:00
const std : : list < ItemProfile * > filteredItems = GetFilteredItems ( desiredItems , seller ) ;
for ( auto desiredItem : filteredItems )
2018-03-29 17:01:57 -04:00
{
2018-07-12 14:41:21 -07:00
CWeenieObject * sellerItem = seller - > FindContainedItem ( desiredItem - > iid ) ;
2018-03-29 17:01:57 -04:00
if ( ! sellerItem )
return WERROR_NO_OBJECT ;
if ( sellerItem - > InqIntQuality ( STACK_SIZE_INT , 1 ) < desiredItem - > amount )
return WERROR_NO_OBJECT ;
if ( sellerItem - > HasContainerContents ( ) ) // can't buy containers that have items in them
return WERROR_NO_OBJECT ;
if ( desiredItem - > amount < = 0 )
continue ;
if ( sellerItem - > InqIntQuality ( ITEM_TYPE_INT , TYPE_UNDEF ) = = TYPE_PROMISSORY_NOTE )
2019-07-07 20:56:15 +00:00
totalValue + = ( uint32_t ) round ( sellerItem - > InqIntQuality ( VALUE_INT , 0 ) ) ;
2018-03-29 17:01:57 -04:00
else
2019-07-07 20:56:15 +00:00
totalValue + = ( uint32_t ) round ( sellerItem - > InqIntQuality ( VALUE_INT , 0 ) * profile . buy_price ) ;
2018-03-29 17:01:57 -04:00
}
if ( totalValue > = MAX_COIN_PURCHASE )
{
seller - > SendText ( " That purchase is too large. " , LTT_DEFAULT ) ;
return WERROR_NO_OBJECT ; // purchase too large
}
//check of we have enough room for the coins.
int maxStackSize ;
int totalSlotsRequired = 1 ;
CWeenieDefaults * weenieDefs = g_pWeenieFactory - > GetWeenieDefaults ( W_COINSTACK_CLASS ) ;
if ( weenieDefs - > m_Qualities . InqInt ( MAX_STACK_SIZE_INT , maxStackSize ) )
{
if ( maxStackSize < 1 )
maxStackSize = 1 ;
2018-08-27 15:47:05 -05:00
totalSlotsRequired = max ( ( int ) ( totalValue / maxStackSize ) , 1 ) ;
2018-03-29 17:01:57 -04:00
}
2018-04-20 18:59:55 -05:00
//if (seller->Container_GetNumFreeMainPackSlots() < max(totalSlotsRequired - (int)desiredItems.size(), 1)) -- This doesn't take in to account that the items are coming out of side packs, causes error when attempting to spawn pyreals into pack. Eats all items.
if ( seller - > Container_GetNumFreeMainPackSlots ( ) < totalSlotsRequired )
2018-03-29 17:01:57 -04:00
{
seller - > SendText ( " There's not enough room for the coins in your inventory. " , LTT_DEFAULT ) ;
return WERROR_NO_OBJECT ;
}
if ( seller - > InqIntQuality ( COIN_VALUE_INT , 0 ) + totalValue > MAX_COIN_ALLOWED )
return WERROR_NO_OBJECT ; // user will have too much wealth
seller - > EmitSound ( Sound_PickUpItem , 1.0f ) ;
// take away the items purchased...
2019-01-07 06:00:21 +00:00
for ( auto desiredItem : filteredItems )
2018-03-29 17:01:57 -04:00
{
//The client won't allow selling partial stacks
//In fact it will request an item split in inventory before adding partial stacks and once in the sell list
//will give the user an error message stating you can't sell partial stacks. So this makes it easier for us.
2018-07-12 14:41:21 -07:00
CWeenieObject * weenie = seller - > FindContainedItem ( desiredItem - > iid ) ;
2018-03-29 17:01:57 -04:00
if ( ! weenie )
continue ;
weenie - > Remove ( ) ; //todo: maybe add vendors relisting loot items like they used to way back.
}
2019-01-07 06:00:21 +00:00
if ( filteredItems . size ( ) > 0 )
DoVendorEmote ( Sell_VendorTypeEmote , seller - > GetID ( ) ) ;
2018-03-29 17:01:57 -04:00
//and add the coins.
seller - > SpawnInContainer ( W_COINSTACK_CLASS , totalValue ) ;
2019-01-07 06:00:21 +00:00
if ( filteredItems . size ( ) < desiredItems . size ( ) )
seller - > NotifyWeenieErrorWithString ( WERROR_TRADE_AI_DOESNT_WANT , GetName ( ) . c_str ( ) ) ;
2018-03-29 17:01:57 -04:00
return WERROR_NONE ;
}
2019-01-07 06:00:21 +00:00
const std : : list < ItemProfile * > CVendor : : GetFilteredItems ( std : : list < ItemProfile * > desiredItems , CPlayerWeenie * seller )
{
for ( std : : list < ItemProfile * > : : iterator i = desiredItems . begin ( ) ; i ! = desiredItems . end ( ) ; )
{
auto desiredItem = * i ;
CWeenieObject * sellerItem = seller - > FindContainedItem ( desiredItem - > iid ) ;
if ( ! sellerItem )
{
i = desiredItems . erase ( i ) ;
continue ;
}
2019-01-17 16:52:28 -06:00
auto sellerItemValue = sellerItem - > InqIntQuality ( STACK_SIZE_INT , TRUE ) > 1 ? sellerItem - > InqIntQuality ( STACK_UNIT_VALUE_INT , TRUE ) : sellerItem - > GetValue ( ) ;
2019-01-07 06:00:21 +00:00
auto sellerItemType = sellerItem - > InqIntQuality ( ITEM_TYPE_INT , 0 , TRUE ) ;
auto sellerItemHasMana = sellerItem - > InqIntQuality ( ITEM_MAX_MANA_INT , 0 , TRUE ) ;
if ( sellerItemType ! = TYPE_PROMISSORY_NOTE & &
( profile . min_value > sellerItemValue | |
profile . max_value < sellerItemValue | |
! ( profile . item_types & sellerItemType ) | |
( ! profile . magic & & sellerItemHasMana ) | |
( profile . trade_id & & profile . trade_id ! = sellerItem - > m_Qualities . id ) ) )
{
i = desiredItems . erase ( i ) ;
}
else
+ + i ;
}
return desiredItems ;
}
2018-03-29 17:01:57 -04:00
void CVendor : : AddVendorItemByAllMatchingNames ( const char * name )
{
int index = 0 ;
2019-07-07 20:56:15 +00:00
uint32_t wcid ;
2018-03-29 17:01:57 -04:00
while ( wcid = g_pWeenieFactory - > GetWCIDByName ( name , index + + ) )
{
AddVendorItem ( wcid , - 1 ) ;
}
}
void CVendor : : GenerateItems ( )
{
ResetItems ( ) ;
}
void CVendor : : GenerateAllItems ( )
{
ResetItems ( ) ;
}
void CVendor : : ValidateItems ( )
{
}
void CVendor : : PreSpawnCreate ( )
{
CMonsterWeenie : : PreSpawnCreate ( ) ;
profile . min_value = InqIntQuality ( MERCHANDISE_MIN_VALUE_INT , 0 , TRUE ) ;
profile . max_value = InqIntQuality ( MERCHANDISE_MAX_VALUE_INT , 0 , TRUE ) ;
profile . magic = InqBoolQuality ( DEAL_MAGICAL_ITEMS_BOOL , FALSE ) ;
profile . item_types = InqIntQuality ( MERCHANDISE_ITEM_TYPES_INT , 0 , TRUE ) ;
2018-04-15 02:21:51 -05:00
profile . buy_price = InqFloatQuality ( BUY_PRICE_FLOAT , 0 , TRUE ) ;
profile . sell_price = InqFloatQuality ( SELL_PRICE_FLOAT , 0 , TRUE ) ;
profile . trade_id = InqDIDQuality ( ALTERNATE_CURRENCY_DID , 0 ) ;
2018-03-29 17:01:57 -04:00
if ( m_Qualities . _create_list )
{
for ( auto i = m_Qualities . _create_list - > begin ( ) ; i ! = m_Qualities . _create_list - > end ( ) ; i + + )
{
2018-08-10 20:25:24 -05:00
if ( i - > destination = = DestinationType : : Shop_DestinationType | | i - > destination = = DestinationType : : Contain_DestinationType )
2018-03-29 17:01:57 -04:00
{
2018-08-08 19:51:43 -05:00
if ( i - > destination = = DestinationType : : Contain_DestinationType | | i - > destination = = DestinationType : : Wield_DestinationType )
{
if ( i - > wcid = = profile . trade_id )
{
CWeenieDefaults * currency = g_pWeenieFactory - > GetWeenieDefaults ( i - > wcid ) ;
profile . trade_name = currency - > m_Qualities . GetString ( NAME_STRING , " " ) ;
}
}
else
AddVendorItem ( i - > wcid , i - > palette , i - > shade , - 1 ) ;
2018-03-29 17:01:57 -04:00
}
}
}
}
2018-07-12 14:41:21 -07:00
void CVendor : : SendVendorInventory ( CWeenieObject * other )
2018-03-29 17:01:57 -04:00
{
ValidateItems ( ) ;
BinaryWriter vendorInfo ;
2019-07-07 20:56:15 +00:00
vendorInfo . Write < uint32_t > ( 0x62 ) ;
vendorInfo . Write < uint32_t > ( GetID ( ) ) ;
2018-08-08 19:51:43 -05:00
2018-03-29 17:01:57 -04:00
profile . Pack ( & vendorInfo ) ;
2019-07-07 20:56:15 +00:00
vendorInfo . Write < uint32_t > ( m_Items . size ( ) ) ;
2018-03-29 17:01:57 -04:00
for ( auto item : m_Items )
{
ItemProfile itemProfile ;
itemProfile . amount = item - > amount ;
2018-07-12 14:41:21 -07:00
itemProfile . iid = item - > weenie - > GetID ( ) ; // for now, use the WCID plus arbitrary number to reference this item
itemProfile . pwd = PublicWeenieDesc : : CreateFromQualities ( & item - > weenie - > m_Qualities ) ;
2018-03-29 17:01:57 -04:00
itemProfile . pwd - > _containerID = GetID ( ) ;
itemProfile . Pack ( & vendorInfo ) ;
}
other - > SendNetMessage ( & vendorInfo , PRIVATE_MSG , TRUE , FALSE ) ;
}
2019-07-07 20:56:15 +00:00
void CVendor : : DoVendorEmote ( int type , uint32_t target_id )
2018-03-29 17:01:57 -04:00
{
if ( m_Qualities . _emote_table )
{
PackableList < EmoteSet > * emoteSetList = m_Qualities . _emote_table - > _emote_table . lookup ( Vendor_EmoteCategory ) ;
if ( emoteSetList )
{
double dice = Random : : GenFloat ( 0.0 , 1.0 ) ;
for ( auto & emoteSet : * emoteSetList )
{
if ( emoteSet . vendorType ! = type )
continue ;
if ( dice < emoteSet . probability )
{
MakeEmoteManager ( ) - > ExecuteEmoteSet ( emoteSet , target_id ) ;
break ;
}
dice - = emoteSet . probability ;
}
}
}
}
2018-07-12 14:41:21 -07:00
int CVendor : : DoUseResponse ( CWeenieObject * player )
2018-03-29 17:01:57 -04:00
{
if ( IsCompletelyIdle ( ) )
{
MovementParameters params ;
TurnToObject ( player - > GetID ( ) , & params ) ;
}
2018-08-08 19:51:43 -05:00
2019-10-27 17:56:23 +00:00
if ( profile . trade_id ) {
2018-08-08 19:51:43 -05:00
profile . trade_num = player - > RecalculateCoinAmount ( profile . trade_id ) ;
2019-10-27 17:56:23 +00:00
} else {
profile . trade_num = 0 ;
2018-08-08 19:51:43 -05:00
player - > RecalculateCoinAmount ( W_COINSTACK_CLASS ) ;
2019-10-27 17:56:23 +00:00
}
2018-04-15 02:21:51 -05:00
2018-03-29 17:01:57 -04:00
SendVendorInventory ( player ) ;
DoVendorEmote ( Open_VendorTypeEmote , player - > GetID ( ) ) ;
2018-12-18 03:26:56 +00:00
m_ActiveBuyers . insert ( player - > GetID ( ) ) ;
2019-09-03 14:18:02 +00:00
return CWeenieObject : : DoUseResponse ( player ) ;
2018-03-29 17:01:57 -04:00
}
void CAvatarVendor : : PreSpawnCreate ( )
{
CVendor : : PreSpawnCreate ( ) ;
// ResetItems();
2019-07-07 20:56:15 +00:00
for ( uint32_t i = 0 ; i < g_pWeenieFactory - > m_NumAvatars ; i + + )
2018-03-29 17:01:57 -04:00
{
AddVendorItem ( g_pWeenieFactory - > m_FirstAvatarWCID + i , - 1 ) ;
}
}
2018-12-18 03:26:56 +00:00
void CVendor : : CheckRange ( )
{
double UseDist = InqFloatQuality ( USE_RADIUS_FLOAT , 0 , TRUE ) ;
2019-07-07 20:56:15 +00:00
for ( std : : set < uint32_t > : : iterator i = m_ActiveBuyers . begin ( ) ; i ! = m_ActiveBuyers . end ( ) ; )
2018-12-18 03:26:56 +00:00
{
CWeenieObject * player = g_pWorld - > FindPlayer ( * i ) ;
if ( player )
{
if ( DistanceTo ( player , true ) > UseDist )
{
DoVendorEmote ( Close_VendorTypeEmote , player - > GetID ( ) ) ;
i = m_ActiveBuyers . erase ( i ) ;
}
else
+ + i ;
}
else
i = m_ActiveBuyers . erase ( i ) ;
}
2019-09-03 14:18:02 +00:00
}