Quantcast
Need help with AbbreviateLargeNumbers function - WoWInterface
Thread Tools Display Modes
12-12-16, 02:41 PM   #1
nxrighthere
A Kobold Labourer
Join Date: Jan 2015
Posts: 1
Need help with AbbreviateLargeNumbers function

Hello, I have an issue with hooking AbbreviateLargeNumbers function. I'm trying to replace the value that this function returns, but my code doesn't work...

For example, this code doesn't work:
Code:
hooksecurefunc("AbbreviateLargeNumbers", function(value)
  local test = 100;
  return test;
end
If I replace a global function it works but cause some taint errors:
Code:
function AbbreviateLargeNumbers(value)
  local test = 100;
  return test;
end
taint.log:
12/13 00:08:54.625 Global variable AbbreviateLargeNumbers tainted by *** - Interface\AddOns\***\Core.lua:277
12/13 00:08:54.625 Execution tainted by *** while reading AbbreviateLargeNumbers - Interface\FrameXML\TextStatusBar.lua:66
12/13 00:08:54.625 TextStatusBar_UpdateTextStringWithValues()
12/13 00:08:54.625 Interface\FrameXML\TextStatusBar.lua:37 TextStatusBar_UpdateTextString()
12/13 00:08:54.625 Interface\FrameXML\UnitFrame.lua:896 UnitFrameManaBar_Update()
12/13 00:08:54.625 Interface\FrameXML\UnitFrame.lua:186 UnitFrame_Update()
12/13 00:08:54.625 Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:121 ArenaEnemyFrame_UpdatePlayer()
12/13 00:08:54.625 Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:192 ArenaEnemyFrame_OnEvent()
12/13 00:08:54.625 ArenaEnemyFrame1:OnEvent()
12/13 00:08:54.625 Interface\FrameXML\TextStatusBar.lua:65
12/13 00:08:54.625 An action was blocked in combat because of taint from *** - ArenaEnemyFrame1:SetPoint()
12/13 00:08:54.625 Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:146 ArenaEnemyFrame_UpdatePlayer()
12/13 00:08:54.625 Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:192 ArenaEnemyFrame_OnEvent()
12/13 00:08:54.625 ArenaEnemyFrame1:OnEvent()
  Reply With Quote
12-12-16, 03:29 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,236
hooksecurefunc executes your code after the hooked function, but does not chain them together as in passing parameters or returns down the chain.

You could create your own function

Code:
local function MyAbbreviateLargeNumbers(val)
	local x = AbbreviateLargeNumbers(val)
	print(x, val)
	return 100
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Need help with AbbreviateLargeNumbers function

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off