Page 1 of 1
Doors not locking?
Posted: Fri May 25, 2007 1:24 am
by stranf
This is a bug I noticed awhile back but apperently forgot to post.
I wonder if someone could verify this.
I set a door to the "locked door" type, as per Xuri's guide. (I can't recall type number off of the top of my head). I didn't specify a more value for a key, I just wanted a locked door.
When my PC clicked on the door it says "You unlock the door and quickly lock it behind you" as if I had a key to it. Basically the locked doors are broken.
Can someone see if this occurs on their shard also?
Posted: Fri May 25, 2007 1:45 am
by Xuri
Verified. As long as the door is of TYPE 13 (locked door), anyone can open it by doubleclicking on it.
I think the "You unlock the door and quickly lock it behind you" is intended for players who are carrying the key to their house, and for GMs that automatically unlock any doors they open.

Posted: Fri May 25, 2007 8:26 pm
by giwo
Off the top of my head it's taking the default more value of the door (0) and looks for an object in your pack with the same more value (0) as a key. I'm thinking we just need a check if( more == 0 ) don't look for a key
Posted: Fri May 25, 2007 9:32 pm
by Xuri
Yep. Just tested giving a door with type 13 a random more value now, and the player could no longer automagically unlock it without a key.

Posted: Sat May 26, 2007 12:39 am
by giwo
in doors.js
Replace this
Code: Select all
function FindKey( pUser, iUsed )
{
var foundKey = false;
var pPack = pUser.pack;
if( pPack != null )
foundKey = FindKeyInPack( pUser, pPack, iUsed );
return foundKey;
}
with this
Code: Select all
function FindKey( pUser, iUsed )
{
var foundKey = false;
if( iUsed.more > 0 )
{
var pPack = pUser.pack;
if( pPack != null )
foundKey = FindKeyInPack( pUser, pPack, iUsed );
}
return foundKey;
}
Let me know if you run into any issues, or that doesn't resolve the problem (I'm far too lazy to test it myself).
Posted: Sat May 26, 2007 1:15 am
by Xuri
Looks like a fix!

Posted: Tue May 29, 2007 11:46 pm
by stranf
Thanks Giwo. I will be testing out this script as soon as I get some free time.