ID:2404565
 
Resolved
Another casualty of the refactor was found: Loading an /icon datum from a file() failed intermittently.
BYOND Version:512.1450
Operating System:N/A
Web Browser:N/A
Applies to:Dream Daemon
Status: Resolved (512.1453)

This issue has been resolved.
(Posted by Lummox JR on behalf of AlcaroIsAFrick.)

Descriptive Problem Summary:

Loading an /icon using a file() reference can result in a bad icon operation sometimes.

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
/datum/background
/*Layers argument
PNG Image = list(list(XMULT,YMULT),list(XSPDOFF,YSPDOFF))
*/

var/is2 = 1
var/list/layers = list()
black
is2 = 0
layers = list(
"_BACKGROUNDS/test/Background.dmi" = list(list(0,0),list(0,0))
)

client
var/datum/background/BGPath = null //Background
var/list/backgrounds = list() //holds a list of overlays which will be updated to show the backgrounds. Not done here.
verb/Create_BGPATH()
BGPath = new /datum/background/black()
world << "<font color='blue'>Created BGPath"
verb/LoopBackgroundUpdate()
while(1)
if(Update_Background()==0)
return
sleep(world.tick_lag)
verb/Update_Background()
backgrounds = list()
if(istype(BGPath,/datum/background))
var/la = 0
for(var/a in BGPath.layers)
la += 1
var/BG1Pa = file(replacetextEx("[a]", ".", "1."))
var/BG2Pa = file(replacetextEx("[a]", ".", "2."))
var/icon/B1Icon = new(BG1Pa)
var/icon/B2Icon = B1Icon
if(BGPath.is2)
B2Icon = new(BG2Pa)
var
wi
he
if(B1Icon)
wi = B1Icon.Width()
he = B1Icon.Height()
if(!he || !wi || !B1Icon || !B2Icon)
world << "<font color='red'>Error loading background! Deleted BGPath and cleared backgrounds."
BGPath = null
backgrounds = list()
return 0
world << "<font color='green'>Success!"
return 1


Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

The problem does not occur in 512.1448.
Lummox JR resolved issue with message:
Another casualty of the refactor was found: Loading an /icon datum from a file() failed intermittently.