ID:100263
 
Not a bug
BYOND Version:474
Operating System:Windows Vista Home Basic
Web Browser:Firefox 3.6.8
Applies to:Dream Seeker
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 Developer forums.
Descriptive Problem Summary:
For some reason I can no longer edit my icon in game and change it to another icon (not included in the RSC).
Other people are able to and this effects more than just one game for me and happens on games I host locally and are hosted by others online.

Numbered Steps to Reproduce Problem:
  1. Go into a game you have can edit yours or other objects icons.
  2. Attempt to edit your icon to one that is not within the RSC.


Code Snippet (if applicable) to Reproduce Problem:
Below is an edit verb that this applies to.
mob/verb
Edit(atom/O in world)
set category = null
set name = "Edit"
set desc="(target) Edit a target item's variables"
var/variable = input("Which variable?","Var") in O.vars
var/default
var/typeof = O.vars[variable]
var/dir
if(isnull(typeof))
send_message(usr, "<font size=1>Unable to determine variable type.", 3)
else if(isnum(typeof))
send_message(usr, "<font size=1>Variable appears to be <b>NUM</b>.", 3)
default = "num"
dir = 1
else if(istext(typeof))
send_message(usr, "<font size=1>Variable appears to be <b>TEXT</b>.", 3)
default = "text"
else if(isloc(typeof))
send_message(usr, "<font size=1>Variable appears to be <b>REFERENCE</b>.", 3)
default = "reference"
else if(isicon(typeof))
send_message(usr, "<font size=1>Variable appears to be <b>ICON</b>.", 3)
typeof = "\icon[typeof]"
default = "icon"
else if(istype(typeof,/atom) || istype(typeof,/datum))
send_message(usr, "<font size=1>Variable appears to be <b>TYPE</b>.", 3)
default = "type"
else if(istype(typeof,/list))
send_message(usr, "<font size=1>Variable appears to be <b>LIST</b>.", 3)
send_message(usr, "<font size=1>*** This function is not possible ***", 3)
default = "cancel"
else if(istype(typeof,/client))
send_message(usr, "<font size=1>Variable appears to be <b>CLIENT</b>.", 3)
send_message(usr, "<font size=1>*** This function is not possible ***", 3)
default = "cancel"
else
send_message(usr, "<font size=1>Variable appears to be <b>FILE</b>.", 3)
default = "file"
send_message(usr, "<font size=1>Variable contains: [typeof]", 3)
if(dir)
switch(typeof)
if(1)
dir = "NORTH"
if(2)
dir = "SOUTH"
if(4)
dir = "EAST"
if(8)
dir = "WEST"
if(5)
dir = "NORTHEAST"
if(6)
dir = "SOUTHEAST"
if(9)
dir = "NORTHWEST"
if(10)
dir = "SOUTHWEST"
else
dir = null
if(dir)
send_message(usr, "<font size=1>If a direction, direction is: [dir]", 3)
var/class = input("What kind of variable?","Variable Type",default) in list("text",
"num","type","reference","icon","file","restore to default","cancel")
var/new_value
switch(class)
if("cancel")
return
if("restore to default")
new_value = initial(O.vars[variable])
if("text")
new_value = input("Enter new text:","Text",\
O.vars[variable]) as text
if("num")
new_value = input("Enter new number:","Num",\
O.vars[variable]) as num
if("type")
new_value = input("Enter type:","Type") \
in typesof(/obj,/mob,/area,/turf)
if("reference")
new_value = input("Select reference:","Reference",\
O.vars[variable]) as mob|obj|turf|area in world
if("file")
new_value = input("Pick file:","File") \
as file
if("icon")
new_value = input("Pick icon:","Icon") \
as icon

if(istype(O, /atom/movable) && (variable == "x" || variable == "y" || variable == "z"))
var
x = variable == "x" ? new_value : O.x
y = variable == "y" ? new_value : O.y
z = variable == "z" ? new_value : O.z
turf/T = locate(x, y, z)
atom/movable/A = O
A.Move(T, forced = 1)
else
if(variable == "name" && (!trimAll(new_value) || trimAll(new_value) == " ")) return
O.vars[variable] = new_value


Expected Results:
Icon is edited and appears in game.

Actual Results:
Icon is set to null

Does the problem occur:
Every time? Or how often?
Every time I try.
In other games?
Yes
In other user accounts?
Yes
On other computers?
I haven't tried on other computers.

When does the problem NOT occur?
It never used to 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.)
It never used to happen in the previous version of BYOND.

Workarounds:
Unknown

You did not include code that can be tested, nor a full description of the steps to follow using that code even if it worked. The code you posted relies on other procs that were not included in the snippet, so it can't simply be plugged into a debug project. Nor am I sure of the exact means you're using to edit your icon (like what values you're choosing in your edit proc). You'll need to provide more information; a demo would be helpful, but just posting working code and instructions on precisely what to enter would be fine.

Your report is also either incorrect or incomplete in the "earlier versions" section. You mentioned this did not happen on the previous version of BYOND, but the previous version was 473; 473 and 474 were minor bug fixes only and did not change any behavior along these lines, so if there is an issue it would have to have appeared no later than 472. Maybe you meant it didn't happen in the last version you used before upgrading to 474, but we need that version number. If you're ever unsure on this, you can leave it blank, or better still you can try some of the older builds which usually gives us a much better idea of where to look.

The only thing I was able to test in this report was that "as icon" still does work correctly in both verbs and input() statements.
It seems clearing my cache fixed the problem.