Batfoxkid / Freak-Fortress-2-Rewrite

The gamemode that's now also a standalone boss maker.
https://forums.alliedmods.net/forumdisplay.php?f=154
GNU General Public License v3.0
17 stars 7 forks source link

[Bug] Small health kit made by attribute `203` isn't dropped to ground #168

Closed M60TM closed 6 months ago

M60TM commented 7 months ago

Description

It seems that the small health kit made by attribute 203 is designed to fall off the boss in a random direction.

Media

One screenshot will be enough to explain this bug. image

More Information

int entity = CreateEntityByName("item_healthkit_small");
if(IsValidEntity(entity))
{
    DispatchKeyValue(entity, "OnPlayerTouch", "!self,Kill,,0,-1");
    DispatchSpawn(entity);
    SetEntProp(entity, Prop_Send, "m_iTeamNum", team);
    SetEntityMoveType(entity, MOVETYPE_VPHYSICS); // <- This line doesn't work.
    velocity[0] = GetRandomFloat(-10.0, 10.0);
    velocity[1] = GetRandomFloat(-10.0, 10.0);
    TeleportEntity(entity, position, _, velocity);
    SetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity", attacker);
}
void CTFPowerup::DropSingleInstance( Vector &vecLaunchVel, CBaseCombatCharacter *pThrower, float flThrowerTouchDelay, float flResetTime /*= 0.1f*/ )
{
//  SetSize( Vector(-8,-8,-8), Vector(8,8,8) );
    SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );
    SetAbsVelocity( vecLaunchVel ); 
    SetSolid( SOLID_BBOX );
    if ( flResetTime )
    {
        ActivateWhenAtRest( flResetTime );
    }

    m_bThrownSingleInstance = true;
    AddSpawnFlags( SF_NORESPAWN );

    SetOwnerEntity( pThrower );
    m_flThrowerTouchTime = gpGlobals->curtime + flThrowerTouchDelay;

    // Remove ourselves after some time
    SetContextThink( &CBaseEntity::SUB_Remove, gpGlobals->curtime + GetLifeTime(), "PowerupRemoveThink" );
}

I have a plan to fix this. However, there is something to choose from.

  1. SDKCall CTFPowerup::DropSingleInstance.
  2. Just setting movetype to MOVETYPE_FLYGRAVITY instead of MOVETYPE_VPHYSICS.