I am trying to setup a simple Pushthrough hook, following the docs. Here is what i do.
1. In syshook.cfg, i add the following:
Code: Select all
SystemHookScript pushthrough.ecl
{
Pushthrough Pushthrough
}
Code: Select all
program PushthroughHook()
Print( "Using PushthroughHook..." );
return 1;
endprogram
exported function Pushthrough(walker, obstructors)
print("Push " + walker.name);
return 1;
endfunction
What happens:Pushthrough:
params: CharRef character, Array of CharRefs in destination tile. When called: on EVERY move of EVERY character. Return: true if walk ok, false to block walk. Used to override core behavior for walking through tiles with other mobiles on them. Since this critical script is called so often, it is a very CPU expensive one to impliment.
When the POL starts up, it says "Using PushthroughHook..." to confirm me the hook has been loaded correctly. When a character tries to push through a mobile, the POL still does standard checks, THEN calls my hook only if the check succeedes.
1. The character tries to push through
2a. If he's full stamina, the core will call my hook and use the return value
2b. If he's not full stamina, the core will just ignore my hook and prevent the character to move
What i would expect to happen:
I would expect the core to just skip the builting pushthrough checks and directly call my hook, in this way:
1. The character tries to push through
2. The core calls my hook and uses the return value
or even call the hook before every single move, just like the doc says.
I had a look the the related source code (charactr.cpp:3820) and concluded this could probably be a long-time bug that has never been reported because, by looking at the most famous distro scripts, it looks like nobody is using this feature.