DrAbcOfficial / asexthook

A metamod plugin for Sven co-op, AngelsScript, Hook and SQLite!
GNU General Public License v3.0
6 stars 0 forks source link

MonsterTraceAttack() missing Vector vecDir. #1

Closed RedSprend closed 2 years ago

RedSprend commented 2 years ago

Using this as map script:

class classname : ScriptBaseMonsterEntity
{
    ~classname()
    {
        g_Hooks.RegisterHook( Hooks::Monster::MonsterTraceAttack, MonsterTraceAttackHook( this.MonsterTraceAttack ) );
    }

    HookReturnCode MonsterTraceAttack( CBaseMonster@ pMonster, entvars_t@ pevAttacker, float flDamage, Vector vecDir, const TraceResult& in ptr, int bitsDamageType )
    {
        return HOOK_CONTINUE;
    }
}

Result:

No matching signatures to 'HookReturnCode MonsterTraceAttackHook(CBaseMonster@, entvars_t@, float, const TraceResult&in, int)'

DrAbcOfficial commented 2 years ago

The Vector used in angelscript is not the same class as the native Vector in half life, so I need time to rebuild the Vector class in angelscripts with ReClass, so I won't add vecDir for now, but if you need to, you can calculate this value yourself via Math. VecToAngles(vecHitPos - vecSrc). :)

DrAbcOfficial commented 2 years ago

well, i just found that all i need do is send a pointer instead of Vector itself, :) fixed in 0655b81