New function
Code:
public addXP()
{
new szid[4]
new szvictim[4]
new szmult[10]
read_argv(1,szid,3)
read_argv(2,szvictim,3)
read_argv(3,szmult,9)
new id = str_to_num(szid)
new victim = str_to_num(szvictim)
new Float:mult = floatstr(szmult)
//stupid check - but checking prevents crashes
if ( id <= 0 || id > 32 || victim <= 0 || victim > 32 ) return
localAddXP(id, floatround(mult * gXPGiven[ gPlayerLevel[victim] ]) )
displayPowers(id, false)
}
This was an oversight. The original code was this way and I never thought to change it. I am not even aware of any hero that uses the multiplier. Be aware that if you code a hero to use a float here and someone uses it without this fix it will prob chop off the float. So 1.5 would become 1. I might merge this into CVS, but I am thinking of adding a little bonus feature for AMXX first.
-----
EDIT: This also requires a change to the include file, I just realized.
Replacement stock in include
Code:
stock shAddXP(id, victim, Float:multiplier )
{
// Use to add XP for a kill initiated by a hero other than standard kill..
server_cmd("sh_addxp %d %d ^"%f^"", id, victim, multiplier)
}
-----
More EDIT:
hmmm... I think doing this will cause a tag mismatch error from any hero using this function in its old state. Because it will be sending an int but the stock is expecting a Float. Guess I will test this out later but I am pretty sure I am correct. Although normally a hero would not even use this feature anymore since extraDamage does the XP stuff you. I am not sure if any updated heroes are even using this function. This may or may not make it into the CVS / next release.
__________________