Page 1 of 1

Issues with UOX3's targeting handling

Posted: Sun Jan 15, 2006 2:47 pm
by Xuri
There are most definitely some issues with how UOX3 handles targeting stuff using the target cursor in UO. I've repeatedly noticed that sometimes the effects I want to give a specific targeted object, are instead performed on my own character.

Basically it seems that every now and then UOX3 doesn't read what you target correctly, and somehow defaults it to your own character instead.

This was most easily visible when I used the 'RREMOVE command I have written earlier (after modifying it to accept characters as well as items) to remove multiple NPCs, and my own character was deleted (while I was online!) instead of the targeted NPC character. I had no checks in the command for if the target was my own character, but still - I targeted another character, not my own.

The modified command, goes in UOX3\JS\COMMANDS\CUSTOM\repeatingcmds.js:

Code: Select all

//Repeated Command: REMOVE
function command_RREMOVE( pSock, execString )
{
	pUser = pSock.currentChar;
	pUser.CustomTarget( 7, "Which object do you wish to remove?" );
}
function onCallback7( pSock, myTarget )
{
	var pUser = pSock.currentChar; 
	if( !pSock.GetWord( 1 ))
			myTarget.Delete();
	else
		pUser.SysMessage( "That's not an object you can remove!" );
	pUser.CustomTarget( 7, "Which object do you wish to remove?" );
}
The error seems to be happening mostly when the targeted object is a character, from my testing.

Posted: Wed Mar 01, 2006 7:03 pm
by giwo
I believe I have found and fixed this issue.

It should have only been happening to a player with serial number 0. I've modified the handling so when it should be invalid the serial number will be changed to 0xFFFFFFFF instead of 0 (as 0 could be a valid character).

Posted: Wed Mar 01, 2006 7:06 pm
by Xuri
Great :D I believe the bug was indeed happening with the first character on my admin account in a world without prespawned NPCs, so it would have had serial 0x00 :)