Closed M60TM closed 6 months ago
It seems that the small health kit made by attribute 203 is designed to fall off the boss in a random direction.
One screenshot will be enough to explain this bug.
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.
CTFPowerup::DropSingleInstance
MOVETYPE_FLYGRAVITY
MOVETYPE_VPHYSICS
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.
More Information
I have a plan to fix this. However, there is something to choose from.
CTFPowerup::DropSingleInstance
.MOVETYPE_FLYGRAVITY
instead ofMOVETYPE_VPHYSICS
.