Permalink
Browse files

Fix #382

  • Loading branch information...
Bara committed Oct 23, 2018
1 parent 11450b1 commit 01209951a5f283bbfa63628ad1a6be66f5cb9638
@@ -211,8 +211,8 @@ public void OnConfigsExecuted()
if (g_cDebug.BoolValue)
{
LogMessage("Log File: \"%s\"", g_sLogFile);
LogMessage("Error File :\"%s\"", g_sErrorFile);
LogMessage("Karma File :\"%s\"", g_sKarmaFile);
LogMessage("Error File: \"%s\"", g_sErrorFile);
LogMessage("Karma File: \"%s\"", g_sKarmaFile);
}
if (g_cLogButtons.BoolValue)
@@ -100,6 +100,8 @@ float g_fSmokeAngle[3] = {0.0,-180.0,0.0};
MissileType g_iType[MAXPLAYERS + 1] = { tNone, ... };
ConVar g_cNoblock = null;
public void OnPluginStart()
{
TTT_IsGameCSGO();
@@ -173,6 +175,11 @@ public void OnMapStart()
PrecacheSound("weapons/hegrenade/explode5.wav");
}
public void OnConfigsExecuted()
{
g_cNoblock = FindConVar("ttt_enable_noblock");
}
public void TTT_OnShopReady()
{
char sName[32];
@@ -505,6 +512,37 @@ public void MissileThink(const char[] output, int caller, int activator, float d
float fFinalAng[3];
GetVectorAngles(fFinalVec, fFinalAng);
TeleportEntity(caller, NULL_VECTOR, fFinalAng, fFinalVec);
if (g_cNoblock == null)
{
g_cNoblock = FindConVar("ttt_enable_noblock");
}
if (g_cNoblock.BoolValue)
{
float fEnemyPos[3];
GetClientAbsOrigin(iClosestEnemy, fEnemyPos);
fEnemyPos[2] += 50.0;
Handle hTrace = TR_TraceRayFilterEx(fNadePos, fEnemyPos, MASK_PLAYERSOLID, RayType_Infinite, TR_DontHitSelf, caller);
int iTarget = -1;
float fDistance = 0.0;
if (TR_DidHit(hTrace))
{
iTarget = TR_GetEntityIndex(hTrace);
fDistance = GetVectorDistance(fNadePos, fEnemyPos);
PrintToChatAll("Target: %d, Distance: %f", iClosestEnemy, fDistance);
if (iTarget == iClosestEnemy)
{
CreateExplosion(caller);
}
}
delete hTrace;
}
}
else if (g_iType[iOwner] == tControl)
{
@@ -517,7 +555,7 @@ public void MissileThink(const char[] output, int caller, int activator, float d
Handle hTrace = INVALID_HANDLE;
hTrace = TR_TraceRayFilterEx(fNadePos, fclientAngles, MASK_SOLID, RayType_Infinite, DontHitOwnerOrNade, caller);
if (TR_DidHit(hTrace) == true)
if (TR_DidHit(hTrace))
{
TR_GetEndPosition(fFinalVec, hTrace);
@@ -556,6 +594,11 @@ public void MissileThink(const char[] output, int caller, int activator, float d
AcceptEntityInput(caller, "FireUser1");
}
public bool TR_DontHitSelf(int entity, int mask, int data)
{
return (entity != data);
}
public void OnGameFrame()
{
LoopValidClients(i)
@@ -577,7 +620,6 @@ public bool DontHitOwnerOrNade(int entity, int contentsMask, any data)
public Action OnStartTouch(int entity, int other)
{
PrintToChatAll("Entity: %d, Other: %d", entity, other);
if (other == 0)
{
// StopSound(entity, 1, "weapons/rpg/rocket1.wav");
@@ -609,7 +651,6 @@ void CreateExplosion(int entity)
g_iType[iMissileOwner] = tNone;
int iExplosion = CreateEntityByName("env_explosion");
if (iExplosion != -1)
{
@@ -305,15 +305,11 @@ int TraceClientViewEntity(int client)
if (TR_DidHit(tr))
{
pEntity = TR_GetEntityIndex(tr);
delete(tr);
delete tr;
return pEntity;
}
if (tr != null)
{
delete(tr);
}
delete tr;
return -1;
}
@@ -179,7 +179,11 @@ public void HookClient(int client)
public void TTT_OnRoundStart(int innocents, int traitors, int detective)
{
TTT_ClearTimer(g_hCooldown);
if (g_hCooldown != null)
{
KillTimer(g_hCooldown);
}
g_hCooldown = null;
g_smGlow.Clear();
@@ -240,7 +244,11 @@ public Action Timer_ActivateTasers(Handle timer)
public void TTT_OnRoundEnd(int winner, Handle array)
{
TTT_ClearTimer(g_hCooldown);
if (g_hCooldown != null)
{
KillTimer(g_hCooldown);
}
g_hCooldown = null;
}
public void TTT_OnClientGetRole(int client, int role)

0 comments on commit 0120995

Please sign in to comment.