ID:141188
 
Code:
obj/house2
density=1
icon='door.dmi'
var/obj/key/K
Click()
usr<<"[owner] is the owner"
Bump(atom/M)
if(locate(K) in M.contents&&K.pass==owner)
usr.loc=locate(17,2,2)
else
usr<<"You have the wrong key!"


Problem description:

Bump doesn't work, I don't know how to correct this.
obj/house
Bump(atom/movable/a)
if(ismob(a))
var/mob/m = a
var/obj/key/k = locate() in m
if(k) //if the key is found...
m.Move(locate(17,2,2))
else
m<<"Wrong key" //not usr...
<font size=+2>Ungh. No usr in proc</font>.

Bump() is called on the object that has done the bumping/movement, and its argument is the Obstacle that has been bumped into. Meaning, in O.Bump(X), O tried to move and bumped into X. This also means that for your override to even execute, the house would have to bump into something... yeah, not likely to happen.
Try this:
atom/movable/Bump(atom/A)
A.Bumped(src)

atom/proc/Bumped(atom/movable/Bumper)


Your proc would work just fine if you did Bumped(atom/movable/M) instead of Bump().

obj/House
Bumped(mob/Bumper)
if(istype(Bumper,/mob))
if(locate(K) in Bumper.contents)
Bumper<<"Go Ahead"
Bumper.loc=locate(the moon)
else
Bumper<<"Don't go ahead"

Remember to check if it is a mob() bumping if you are doing anything with mob-only information. In this case everything has a contents list but still should be careful.