Topic: Hook releas?
Heelo,
so i am trying to change the hook time for normal hookable tiles, so it behaves like when you hook a player, where the hook releases after a certain time.
So what I did was just copying the code I found for the normal release with the player and removing all the parts where it mentions the player.
(bottom if is mine)
// release hook (max hook time is 1.25
m_HookTick++;
if(m_HookedPlayer != -1 && (m_HookTick > SERVER_TICK_SPEED+SERVER_TICK_SPEED/5 || !m_pWorld->m_apCharacters[m_HookedPlayer]))
{
m_HookedPlayer = -1;
m_HookState = HOOK_RETRACTED;
m_HookPos = m_Pos;
}
if(m_HookTick > SERVER_TICK_SPEED/3)
{
m_HookedPlayer = -1;
m_HookState = HOOK_RETRACTED;
m_HookPos = m_Pos;
}
This works to some extent, but it introduces a strange bug, where when the player hooks on to a ledge sideways or directly under a tile, it waits around 5 seconds and then the frame jumps to the player's actual position on the ground.
Someone have an idea what could cause this?
Not really experienced with programming xD but is fun to dig through the code so far.
Hope yall have a nice day .