Wall
parent_type = /obj
density = 1
mob
Bump(atom/O)
..()
if(isobj(O))
var/obj/DelObj = O
del DelObj
Problem description:
Despite having a parent type, the wall doesn't seem to return 1 for isobj(O). Is this intended behavior?
Code:
Wall Problem description: Despite having a parent type, the wall doesn't seem to return 1 for isobj(O). Is this intended behavior? |
Dec 23 2013, 1:20 pm
|
|
If I remember correctly, Wall is it's own type when you define it using parent_type. It inherits the class structure from obj but isn't defined as an obj. That may be what the problem is.
|
I figured that it'd be that. I'm kinda sad it inherits obj variables but not type.
|
thing I think you're having a different issue here. |
I believe for that code to work, you'd have to check the atom's type explicitly. I'm mobile and it's untested code.
mob |
I went with defining my own isWall() and isBuilding proc anyway because I plan to have destructible environment anyway. I'm still confused about why, like Kaiochao posted the code didn't work though.
|
To be fair, I'm not sure who you're using isobj() anyways. istype is just easier to use, in my opinion. It would keep errors like that down.
|
From a test I just did, isobj() will return true for any object derived from /obj, even if it has a parent_type defined.
oobj edit: you're allowed to have more than one obj in isobj(). The reference says isobj(Loc1, Loc2, ...) |
In response to Makeii
|
|
I already did this test. See reply #3.
|