ID:101857
 
Not a bug
BYOND Version:475
Operating System:Windows XP Pro
Web Browser:Opera 9.80
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Duplicates:id:101881
Descriptive Problem Summary:

When an icon is created and nothing is passed to its constructor the DrawBox proc doesn't fail but it doesn't do anything.

Code Snippet (if applicable) to Reproduce Problem:
#define DEBUG
mob
Login()
var/icon/i = new()
// var/icon/i = new('icons.dmi')

world << "[i.Width()] x [i.Height()]"

i.DrawBox(rgb(0,0,0,255),1,1,32,32)
world << "\icon[i]"
world << "Done!"


Expected Results:

I expect both (using the empty and non-empty icon constructors) to result in printing a 32x32 black box.

Actual Results:

When you use the empty constructor the icon's size is reported as being 32x32 but when the icon is output nothing is shown. The proc executes to completion ("Done!" is printed) but no icon or error message is printed.

Does the problem occur:
Every time? Or how often?
In other games?
In other user accounts?
On other computers?

Every time.

When does the problem NOT occur?

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.)

Not that I know of.

Workarounds:

I'd like to be able to create a blank icon without knowing the name of an icon file or requiring an icon to be in the .rsc file. For this reason I haven't found any satisfactory workarounds.
This isn't actually a bug, but a limitation in the current system. Basically the failure is happening because there are no icon states to modify. Normally DrawBox() and other such procs operate on all the icons in the file, and a file created in this manner has no content--so nothing can be modified.

I'd definitely like to improve on our capacity to edit icons at runtime since creating a new blank state would be a highly desirable thing to do. A workaround in the meantime is to have an icon file with a single blank state.