ID:1980004
 
Resolved
issaved() returned null in some cases, instead of always returning only 1 or 0.
BYOND Version:509.1313
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Chrome 46.0.2490.80
Applies to:Dream Daemon
Status: Resolved (509.1314)

This issue has been resolved.
Descriptive Problem Summary:
It appears issaved() returns null when used to test the saveability of a global variable. The reference states that the function should return 1 or 0, but it only seems to apply if the variable is attached to an object.

Code Snippet (if applicable) to Reproduce Problem:
var dreamer = "lordandrew"
var global/sleeper = "kaiochao"
var tmp/tempo = "drums"
var const/constellation = "orion"

mob/verb/TheBigGame()
world << issaved(dreamer)
world << isnull(issaved(dreamer))
world << issaved(sleeper)
world << isnull(issaved(sleeper))
world << issaved(tempo)
world << isnull(issaved(tempo))
// Testing out an "atomic" variable.
world << issaved(src.density)
/*
// I discovered the below two don't work at all due to an unrelated
// bug with issaved(), referenced in the thread linked below:
// http://www.byond.com/forum/?post=1878028
world << issaved(constellation)
world << isnull(issaved(constellation))
*/

Expected Results:
issaved() should return 0 for global variables.

Actual Results:
issaved() returns null for global variables.
Ah, this may be related to atom.transform issues I posted here
http://www.byond.com/forum/?post=1979983
It's not related, but I do see where it's happening.

Returning null appears to be intentional in these cases when dealing with a var type that isn't saveable, such as globals and proc vars. I'm not sure why, so I'll look into it further. It seems reasonable that it should return 0 instead of null.
Lummox JR resolved issue with message:
issaved() returned null in some cases, instead of always returning only 1 or 0.