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?
Dblclickself
Re: Dblclickself
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 );
endprogramRe: Dblclickself
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
If player is on an horse, it's correctly called. I don't understand why.
Code: Select all
program dblClickSelf(who)
print("called");
endprogramIf player is on an horse, it's correctly called. I don't understand why.
Re: Dblclickself
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.
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
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.
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
Just be very careful with this one because this handles double clicking of everything too...