Skip to content

Hover and parser ignore where the function is defined #5

Description

@ChaseTownsend

i have this snippet that causes the problem

function CTFPlayer::GetWeaponInSlotNew(slot)
{
	. . .
	local weapon = GetWeaponInSlot(slot) // throws warning [Expected parameter of type 'CTFPlayer', but got 'integer']
	if (weapon)
	{
		local weaponSlot = weapon.GetSlot()
	. . .
}

and this is where the functions are defined
one is a method on CTFPlayer, while the other is a deprecated older function
normally when running this, it always perfers the method of CTFPlayer

function CTFPlayer::GetWeaponInSlot(slot = 0)
	return EnableStringPurge(GetPropEntityArray(this, "m_hMyWeapons", slot))

function ROOT::GetWeaponInSlot(player, slot = 0)
{
	if( !player ) return null
	DeprecatedWarning(getstackinfos(1), getstackinfos(2))
	return player.GetWeaponInSlot(slot)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions