ID:2256093
 
Not a bug
BYOND Version:511
Operating System:Windows 10 Pro 64-bit
Web Browser:Firefox 53.0
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.
Descriptive Problem Summary:
isobj() asserts that child objects of /atom/movable are /obj. I'm unsure if this is intentional, but it seems unusual.

Numbered Steps to Reproduce Problem:
1) Declare a subtype of /atom/movable
2) Use isobj(that_object)

Code Snippet (if applicable) to Reproduce Problem:
/obj/an_object

/atom/movable/a_movable

/world/New()
var/obj/an_object/i_obj = new()
var/atom/movable/a_movable/i_am = new()

world.log << "isobj(i_obj): [isobj(i_obj)]"
world.log << "isobj(i_am): [isobj(i_am)]"


Expected Results:
isobj(i_obj): 1
isobj(i_am): 0


Actual Results:
isobj(i_obj): 1
isobj(i_am): 1


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

When does the problem NOT occur?
Always occurs

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

Workarounds:
Just coding around it.
Lummox JR resolved issue (Not a bug)
Yes it's intentional. There's no such thing as a child of /atom/movable that's not either an obj or a mob. It's intended to be an abstract type.
But ismob(atom_movable_instance) returns FALSE. So is the bug that ismob() returns false, rather than isobj() returning true, if it's supposed to be 'both/either'?
There is no bug. When the engine is told to instantiate an object that derives from /atom/movable but not from /obj or /mob, it instantiates it as an obj because it has to be one or the other. Even though it doesn't derive from /obj, that is not the test that isobj() or ismob() use. Those procs are based on whether the actual internal object is an obj or a mob.
Ah, thanks for the info!
isobj works on the internal byond typeid, its not the same as istype(thing, /obj/)

at /tg/ we had to map isobj to istype(thing, /obj/) using macros to fix this confusion
In response to Lummox JR
The same is true for /atom -> /turf, is it not?
(ie: /atom children are instantiated as turfs)
In response to CrimsonVision
CrimsonVision wrote:
The same is true for /atom -> /turf, is it not?
(ie: /atom children are instantiated as turfs)

I'm not really sure what a raw /atom derivative would instantiate as. A turf seems unlikely.
Hmm, I was sure I heard that somewhere.
mob/verb/TestT()
var/atom/A=new(loc)
world.log << "isobj(A): [isobj(A)]"
world.log << "ismob(A): [ismob(A)]"
world.log << "isarea(A): [isarea(A)]"
world.log << "isturf(A): [isturf(A)]"

CrimsonVision was right. The only one that returned TRUE was isturf()
Could be that I simply did the test, yeah.
I do recall hearing it from someone, I think it was actually Lummox himself but he doesn't seem to recall it so perhaps it was simply from experimentation.