Page 1 of 1

Problem with the JS version of resurrect command

Posted: Mon Jul 26, 2004 4:35 pm
by Xuri

Code: Select all

function command_RESURRECT( socket, cmdString )
{
	var targMsg = GetDictionaryEntry( 194, socket.Language );
	socket.CustomTarget( 1, targMsg );
}

function onCallback1( socket, ourObj )
{
	if( ourObj.isChar )
		ourObj.Resurrect();
}
When trying to use it on a character, I get this in console:
| ERROR: JS script failure: Message (TypeError: ourObj has no properties), detai
led data is
| ERROR: Filename: d:/uox3/js/commands/targeting/kill.js
Line Number: 61
| ERROR: Erroneous Line: (null)
Token Ptr: (null)

Posted: Mon Jul 26, 2004 4:38 pm
by Xuri
Hm apparently only happens when the dead GM ghost tries to resurrect himself. Targeting another player character seems to work fine.

Posted: Mon Jul 26, 2004 4:39 pm
by giwo
Is line 61 the isChar check or the Resurrect() call ?

Posted: Mon Jul 26, 2004 4:42 pm
by Xuri
The isChar line. But it doesn't matter, because I tried commenting it out, and whee - UOX3 then crashed out on the Resurrect() call =)

Posted: Mon Jul 26, 2004 4:53 pm
by Xuri
More info on the bug. After closing the client and logging back in with my dead GM character, the resurrect command works. So there's apparently something that happens when my character dies which stops UOX3 from seeing the character as a valid target or something.

BTW, I added PACK as a shortcut for KILLing layer 0x15.

Posted: Mon Jul 26, 2004 4:56 pm
by giwo
Xuri wrote:BTW, I added PACK as a shortcut for KILLing layer 0x15.
And that is what I love about JS ;)

Well, basically that means that something is fudgy with it automatically calculating the serial sent as the target from the client. I'll have to look into it and see what is causing the issue.

Posted: Mon Jul 26, 2004 4:59 pm
by giwo
As for the crash when you try to run Resurrect() with a bad character... I suppose I should start making use of JSEncapsulate in the JSMethods...

*sigh* ahh well, more work ;)

Posted: Tue Jul 27, 2004 4:15 pm
by giwo
Well... I added a check to prevent that crash if you pass a bad character.

Still need to look into why it was passing you a bad object to begin with.