Permalink
Browse files

Fix #382

  • Loading branch information...
Bara committed Oct 23, 2018
1 parent 11450b1 commit 51761b6020cb42374ae346bbaa83d771ef61137c
@@ -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,33 @@ 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_SOLID, RayType_Infinite, TR_DontHitSelf, caller);
int iTarget = -1;
if (TR_DidHit(hTrace))
{
iTarget = TR_GetEntityIndex(hTrace);
if (iTarget == iClosestEnemy)
{
CreateExplosion(caller);
}
}
delete hTrace;
}
}
else if (g_iType[iOwner] == tControl)
{
@@ -517,7 +551,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 +590,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 +616,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 +647,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 51761b6

Please sign in to comment.