summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/ClientHandle.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index f526432b4..792fc3db4 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -230,7 +230,7 @@ void cClientHandle::Authenticate(void)
m_Player->SetIP (m_IPString);
- cRoot::Get()->GetPluginManager()->CallHook(cPluginManager::HOOK_PLAYER_SPAWN, 1, m_Player);
+ cRoot::Get()->GetPluginManager()->CallHook(cPluginManager::HOOK_PLAYER_JOIN, 1, m_Player);
m_ConfirmPosition = m_Player->GetPosition();
@@ -258,6 +258,8 @@ void cClientHandle::Authenticate(void)
// Broadcast this player's spawning to all other players in the same chunk
m_Player->GetWorld()->BroadcastSpawn(*m_Player, this);
+
+ cRoot::Get()->GetPluginManager()->CallHook(cPluginManager::HOOK_PLAYER_SPAWN, 1, m_Player);
}
@@ -920,7 +922,13 @@ void cClientHandle::HandleUseEntity(int a_TargetEntityID, bool a_IsLeftClick)
void cClientHandle::HandleRespawn(void)
{
+ if( m_Player == NULL )
+ {
+ Destroy();
+ return;
+ }
m_Player->Respawn();
+ cRoot::Get()->GetPluginManager()->CallHook(cPluginManager::HOOK_PLAYER_SPAWN, 1, m_Player);
}