View Single Post
06-18-18, 10:58 AM   #8
jeruku
A Cobalt Mageweaver
 
jeruku's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 223
Arguments are reserved(?)

In the old days of scanning for nameplates JamPlates used the method of declaring variables as arguments to reserve memory.

Edit: Think there was a misunderstanding. The global function was localized because it bothered me.

Lua Code:
  1. -- get/set mapID somewhere/somehow
  2. local function GetPlayerMapPos(px, py)  --  declare variables as arguments
  3.     -- some stuff here
  4.     px, py = C_Map.GetPlayerMapPosition(mapID, "player"):GetXY()
  5.     -- more stuff
  6. end
__________________
"I have not failed, I simply found 10,000 ways that did not work." - Thomas Edison

Last edited by jeruku : 06-18-18 at 07:36 PM. Reason: Misunderstanding
  Reply With Quote