CGrappleHook* CGrappleHook :: Create( Vector Pos, Vector Aim, CBasePlayer* Owner ) { ALERT( at_console, "^2HLU -> ^3weapon_grapple ^2-> Tongue spawned.\n"); CGrappleHook* Hook = GetClassPtr( (CGrappleHook*)NULL ); UTIL_SetOrigin( Hook->pev, Pos ); Hook->pev->angles = Aim; Hook->Spawn(); Hook->SetTouch( &CGrappleHook::Hit ); Hook->pev->owner = Owner->edict(); Hook->myowner = Owner; return Hook; }
CGrappleHook *CGrappleHook::HookCreate(const Vector &vecOrigin, const QAngle &angAngles, CBaseEntity *pentOwner) { // Create a new entity with CGrappleHook private data CGrappleHook *pHook = (CGrappleHook *)CreateEntityByName("grapple_hook"); UTIL_SetOrigin(pHook, vecOrigin); pHook->SetAbsAngles(angAngles); pHook->Spawn(); CWeaponGrapple *pOwner = (CWeaponGrapple *)pentOwner; pHook->m_hOwner = pOwner; pHook->SetOwnerEntity(pOwner->GetOwner()); pHook->m_hPlayer = (CBasePlayer *)pOwner->GetOwner(); return pHook; }