public CSpellPickup CObjectCartDispenser::DropSpellPickup()
{
CSpellPickup *pSellPickup;
if (g_pGameRules->m_halloweenScenario == HELLTOWER_SCENARIO)//Yes this means only helltower can drop spells, unless you use a plugin and set m_halloweenScenario on 4
{
if (m_spawnflags & HEAL_DISGUISED_STEALTHED_SPIES)
{
CalcAbsolutePosition();
}
pSellPickup = g_pGameRules->DropSpellPickup(m_vecAbsOrigin, 0); //(CTFGameRules::DropSpellPickup)
}
}
public CSpellPickup CTFGameRules::DropSpellPickup(const Vector *vecPosition, int iSpellTier)
{
CSpellPickup *pSellPickup;
if ( IsUsingSpells() )
{
//Some vecpostion changes not really important
CBaseEntity *pEntity = CBaseEntity::CreateNoSpawn("tf_spell_pickup", vecPosition, vec3_angle, 0);
pSellPickup = (CSpellPickup *)pEntity;
if ( pSellPickup )
{
pSellPickup->m_nTier = iSpellTier;
DispatchSpawn(pSellPickup);
Vector *vecVelocity;
//Velocity calculation crap
CTFPowerup::DropSingleInstance((CTFPowerup *)pSellPickup, vecVelocity, 0, 0.0, 0.1);
}
}
}
return pSellPickup;
}
public void CTFPowerup::DropSingleInstance(Vector *vecVelocity, CBaseCombatCharacter *pPlayer, float flSomething, float flSomething2)
{
//Begining of CTFPowerup::DropSingleInstance
//Only that part is interesting
SetMoveType(MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE);
SetAbsVelocity(vecVelocity);
//Something stored at 368
pSomething->SetSolid(SOLID_BBOX);
}