reference not updating... bug?

Monkey Forums/Monkey Bug Reports/reference not updating... bug?

Nobuyuki(Posted 2015) [#1]
Hi,

I'm having a bit of a problem updating a reference to a variable that's set as Private Global (static) in my class. I'm not sure if I made a typo, or I'm not understanding how the reference stuff works here, so my apologies if I screwed this up.

The problem occurs in the Set() function, and basically any function that tries to update currentPool in this class. This is for an asset loader, which stores Images in "asset pools" (actually a StringMap<StringMap<Image>>). Retreiving an asset works, however it seems that I'm unable to manually set currentPool to the one I want, nor can the search function update it automatically, which makes using this class very inefficient.

I'm using v82a. I'm aware that some things related to Private/Public directives may have changed recently, but since I haven't tested this code on other versions, I don't know if it works on older/newer ones.



edit: to test this in an example, put some assets in the data folders I specified above, and try loading from the different pools multiple times. The "Resource x found in y" message should only appear once when attempting to load an asset from a different pool, and shouldn't appear at all if Set() is called and pointed to the proper pool first. However as I run this code now, it never seems to update currentPool, either from Get() or Set().....


marksibly(Posted 2015) [#2]
Can you reduce it down a bit?

If not, can you send me a zip with some assets in it?


Nobuyuki(Posted 2015) [#3]
I can send you a zip. Email?

Edit: Actually, here. I'll keep this file up for a few days https://dl.dropboxusercontent.com/u/1417196/testRes.zip


marksibly(Posted 2015) [#4]
Perhaps this...

If currentPool <> Null
	currentPool.Get(assetName)
End If


...is supposed to be...

If currentPool <> Null
	out=currentPool.Get(assetName)
End If


?


Nobuyuki(Posted 2015) [#5]
wow, how did I miss that? 4am coding oversights........

thanks a bunch, sorry for the time sink, lol :(