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)
}
i have this snippet that causes the problem
and this is where the functions are defined
one is a method on
CTFPlayer, while the other is a deprecated older functionnormally when running this, it always perfers the method of CTFPlayer