ID:146774
 
Code:
obj
Houses
icon = 'BHouse.dmi'
icon_state=""
density = 1
Green
name = "Green"
CA
icon_state="2,0"
Bump(mob/M)
if(istype(M,/mob/character))
M.loc=locate(1,1,1)
else
return


Problem description:
Well, basically when ever I bump...nothing happens =p. I actually used Entered() before I changed it from an obj to a turf. It needs to be a turf sicne I am using SwapColor() a lot, and that messes the turf up by making the background black or something. Well yeah, that isn't working, it is basically suppose to be a door >.>
Well, first of all, in atom/movable/Bump(atom/obstacle), src, the atom/movable, is the bumper, while obstacle is the obstacle being bumped. Since, as you told me in Chatters, CA is a door (make your type names more descriptive than "CA"!), you're probably looking for atom/Bumped(atom/movable/bumper) instead.

atom/movable/Bump(atom/obstacle)
..()
if(obstacle)
obstacle.Bumped(src)

//When an atom is Bump()ed by an atom/movable, atom/Bumped() will be called
atom/proc/Bumped(atom/movable/bumper)


Now, using that, we can fix your code:

obj
Houses
icon = 'BHouse.dmi'
icon_state=""
density = 1
Green
name = "Green"
CA
icon_state="2,0"
Bumped(mob/character/M)
if(istype(M))//If M is REALLY a mob/character
M.loc=locate(1,1,1)


Notice that I excluded the <font color=blue>else</font color=blue> in Bumped(): it was unnecessary.
In response to Wizkidd0123
Ah, thanks a lot Wizzy. That cleared it up.