Page 1 of 1

Dblclickself

Posted: Mon Apr 04, 2011 12:41 am
by xeon
I found a weird thing about dblclickself.src. It's called only when a player is mounting an animal. If the player is afoot, it's not called.
Anyone experienced the same thing?

Re: Dblclickself

Posted: Thu Apr 14, 2011 4:40 am
by xeon
Anyone? :(

Re: Dblclickself

Posted: Thu Apr 14, 2011 1:33 pm
by *Edwards
This is the code I use and there is no problems..

Code: Select all

use uo;
use os;
use npc;

include "include/client";
include ":mounts:mounts";

program core_dblClickSelf( who )

	var mount := GetEquipmentByLayer( who, LAYER_MOUNT );
	if( mount && !who.warmode && !who.paralyzed && !who.frozen )
		return MP_Unmount( who );
	endif
	
	return OpenPaperdoll( who, who );
endprogram

Re: Dblclickself

Posted: Thu Apr 14, 2011 11:22 pm
by xeon
Thank you for your answer Edwards. The problem is that the script isn't simply called if player is afoot. I checked this with a simple

Code: Select all

program dblClickSelf(who)
print("called");
endprogram

If player is on an horse, it's correctly called. I don't understand why.

Re: Dblclickself

Posted: Fri Apr 15, 2011 12:27 am
by CWO
OK I've tested this and confirmed that the script doesn't run when you're not mounted. I've looked into the POL source code to find out where this problem lies and what I've discovered is that this is actually a lot to do with the client.

When you double click something, it sends a packet with the serial number of what is double clicked.
When you are mounted and double click yourself, it does what I mentioned above just fine.
When you are dismounted and double click yourself, it sends your serial number + 0x80000000.
Now POL knows about this and it will send your paperdoll but skip running the script. Why? Because if you use the "Open Paperdoll" button on the menu or use the macro hotkeys, it sends the double click with your serial number + 0x80000000 whether you're mounted or not. So the reason it doesn't run while dismounted is because the client tells POL the exact same thing when you use the "Open Paperdoll" macro and double clicking yourself while dismounted.

Re: Dblclickself

Posted: Sun Apr 17, 2011 1:34 pm
by xeon
Aaaah, now I've understood, thank you CWO!
I was trying to do a workaround for a bug of the client version which we use (AoS) when player account is set to "UOExpansion AoS". In this situation, when the player open it's paperdoll, our client show the player as in war status, even if player is in peace. This is obviously a client bug. I've almost fixed it, but after these information, I think I'll do a packet hook for the "Display paperdoll" packet.

Re: Dblclickself

Posted: Tue Apr 19, 2011 10:25 pm
by CWO
Just be very careful with this one because this handles double clicking of everything too...