fixed trigger OnStartTouch/OnEndTouch bug caused by TeleportEntity

fixed reloading zombiereloaded plugin
reset player velocity on respawn (high speed in spec -> zspawn)
This commit is contained in:
2016-05-08 03:10:25 +02:00
parent 2d1cdf7a36
commit cea1b84965
5 changed files with 69 additions and 1 deletions

View File

@@ -183,6 +183,10 @@ bool:RespawnSpawnClient(client, bool:zombie = false, bool:zombieIfSuicide = fals
// Spawn player.
CS_RespawnPlayer(client);
// Reset player velocity
float fResetVelocity[3] = {0.0, 0.0, 0.0};
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, fResetVelocity);
// Check if first zombie has spawned.
if (InfectHasZombieSpawned())
{

View File

@@ -33,6 +33,7 @@ new g_iToolsLMV;
new g_iToolsHasNightVision;
new g_iToolsNightVisionOn;
new g_iToolsFOV;
new Handle:g_hToolsSetAbsVelocity = INVALID_HANDLE;
/**
* @endsection
@@ -90,6 +91,24 @@ ToolsFindOffsets()
LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Offset \"CBasePlayer::m_iFOV\" was not found.");
}
// void CBaseEntity::SetAbsVelocity( const Vector &vecAbsVelocity )
Handle hGameConf = LoadGameConfigFile("zombiereloaded");
if (hGameConf != INVALID_HANDLE)
{
StartPrepSDKCall(SDKCall_Player);
if (PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "CBaseEntity_SetAbsVelocity"))
{
PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef);
g_hToolsSetAbsVelocity = EndPrepSDKCall();
}
else
LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "SDKCall \"CBaseEntity::SetAbsVelocity\" was not found.");
CloseHandle(hGameConf);
}
else
LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Tools, "Offsets", "Couldn't load zombiereloaded game config!");
// Forward event to modules.
WeaponsOnOffsetsFound();
AccountOnOffsetsFound();

View File

@@ -64,7 +64,10 @@ stock ToolsClientVelocity(client, Float:vecVelocity[3], bool:apply = true, bool:
}
// Apply velocity on client.
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
if(g_hToolsSetAbsVelocity == INVALID_HANDLE) // Fallback to old one
TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vecVelocity);
else // Fixes trigger OnStartTouch/OnEndTouch bug
SDKCall(g_hToolsSetAbsVelocity, client, vecVelocity);
}
/**