Welcome to the Builder Academy

Question Bug in AutoKey

More
27 Feb 2016 21:09 #5616 by cunning
Bug in AutoKey was created by cunning
Some of the TBAMUD admin may not know me, but i was involved in the DOOM/Rasputin code and many other snippets which are in TBAMUD.

I have found a bug in AUTOKEY. It was pointed out to me that autokey opens the door but when you close it, it locks the door with or without the key.

I have confirmed that the issue is that we never remove the LOCKED bit when the door is opened. That is because we only send in the subcmd "SCMD_OPEN" which opens the door but we never send it into SCMD_UNLOCK.

The fix is simple. Just add the following:

send_to_char(ch, "It is locked, but you have the key.\r\n");
do_doorcmd(ch, obj, door, SCMD_UNLOCK);
do_doorcmd(ch, obj, door, subcmd);


I have confirmed that this does fix the issue with closing a door with no key with AUTOKEY enabled. It took two days for me to figure it out, because turning off autokey would remove the issue. So I focused on Autokey itself.

stat the room before opening a door using "autokey" than stat it afterwards. You will see the LOCKED bit still on there but the CLOSED bit is removed.
The following user(s) said Thank You: Fizban, WhiskyTest

Please Log in or Create an account to join the conversation.

More
27 Feb 2016 21:42 #5617 by WhiskyTest
Replied by WhiskyTest on topic Bug in AutoKey
Such an obscure bug, thanks!
I removed the *click* message from the block of code you mentioned - the unlock command also '*clicks*' so I found I was getting two clicks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.160 seconds