Minor optimizations.

This commit is contained in:
shavitush 2016-11-04 09:50:16 +02:00
parent 9e91f9373e
commit 82829e8b16
No known key found for this signature in database
GPG Key ID: 0A298F154527B9A4
7 changed files with 45 additions and 63 deletions

View File

@ -427,6 +427,7 @@ public Action Command_TeleportEnd(int client, int args)
if(gB_Zones && Shavit_ZoneExists(Zone_End))
{
Shavit_StopTimer(client);
Call_StartForward(gH_Forwards_OnEnd);
Call_PushCell(client);
Call_Finish();
@ -1203,8 +1204,6 @@ void SQL_SetPrefix()
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
}
else
{
char[] sLine = new char[PLATFORM_MAX_PATH*2];
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
@ -1214,7 +1213,6 @@ void SQL_SetPrefix()
break;
}
}
delete fFile;
}

View File

@ -240,7 +240,6 @@ public void OnPluginStart()
// crons
CreateTimer(1.0, Timer_Scoreboard, 0, TIMER_REPEAT);
CreateTimer(gF_AdvertisementInterval, Timer_Advertisement, 0, TIMER_REPEAT);
if(LibraryExists("dhooks"))
{
@ -370,6 +369,8 @@ public void OnMapStart()
Shavit_OnStyleConfigLoaded(-1);
Shavit_OnChatConfigLoaded();
}
CreateTimer(gF_AdvertisementInterval, Timer_Advertisement, 0, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
bool LoadAdvertisementsConfig()
@ -723,13 +724,11 @@ public void OnWeaponDrop(int client, int entity)
// hide
public Action OnSetTransmit(int entity, int client)
{
if(client != entity && gB_Hide[client])
{
if(!IsClientObserver(client) || (GetEntProp(client, Prop_Send, "m_iObserverMode") != 6 && GetEntPropEnt(client, Prop_Send, "m_hObserverTarget") != entity))
if(gB_Hide[client] && client != entity && (!IsClientObserver(client) || (GetEntProp(client, Prop_Send, "m_iObserverMode") != 6 &&
GetEntPropEnt(client, Prop_Send, "m_hObserverTarget") != entity)))
{
return Plugin_Handled;
}
}
return Plugin_Continue;
}
@ -881,10 +880,10 @@ public int MenuHandler_Teleport(Menu menu, MenuAction action, int param1, int pa
{
if(action == MenuAction_Select)
{
char[] info = new char[16];
menu.GetItem(param2, info, 16);
char[] sInfo = new char[16];
menu.GetItem(param2, sInfo, 16);
if(!Teleport(param1, StringToInt(info)))
if(!Teleport(param1, StringToInt(sInfo)))
{
Command_Teleport(param1, 0);
}

View File

@ -992,8 +992,6 @@ void SQL_SetPrefix()
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
}
else
{
char[] sLine = new char[PLATFORM_MAX_PATH*2];
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
@ -1003,7 +1001,6 @@ void SQL_SetPrefix()
break;
}
}
delete fFile;
}

View File

@ -218,8 +218,6 @@ void SQL_SetPrefix()
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
}
else
{
char[] sLine = new char[PLATFORM_MAX_PATH*2];
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
@ -229,7 +227,6 @@ void SQL_SetPrefix()
break;
}
}
delete fFile;
}

View File

@ -143,8 +143,6 @@ void SQL_SetPrefix()
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
}
else
{
char[] sLine = new char[PLATFORM_MAX_PATH*2];
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
@ -154,7 +152,6 @@ void SQL_SetPrefix()
break;
}
}
delete fFile;
}

View File

@ -1328,8 +1328,6 @@ void SQL_SetPrefix()
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
}
else
{
char[] sLine = new char[PLATFORM_MAX_PATH*2];
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
@ -1339,7 +1337,6 @@ void SQL_SetPrefix()
break;
}
}
delete fFile;
}

View File

@ -2054,8 +2054,6 @@ void SQL_SetPrefix()
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
}
else
{
char[] sLine = new char[PLATFORM_MAX_PATH*2];
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
@ -2065,7 +2063,6 @@ void SQL_SetPrefix()
break;
}
}
delete fFile;
}