mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
Minor optimizations.
This commit is contained in:
parent
9e91f9373e
commit
82829e8b16
@ -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();
|
||||
@ -1202,18 +1203,15 @@ void SQL_SetPrefix()
|
||||
{
|
||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
||||
}
|
||||
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
|
||||
else
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
delete fFile;
|
||||
|
||||
@ -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,12 +724,10 @@ public void OnWeaponDrop(int client, int entity)
|
||||
// hide
|
||||
public Action OnSetTransmit(int entity, int client)
|
||||
{
|
||||
if(client != entity && gB_Hide[client])
|
||||
if(gB_Hide[client] && client != entity && (!IsClientObserver(client) || (GetEntProp(client, Prop_Send, "m_iObserverMode") != 6 &&
|
||||
GetEntPropEnt(client, Prop_Send, "m_hObserverTarget") != entity)))
|
||||
{
|
||||
if(!IsClientObserver(client) || (GetEntProp(client, Prop_Send, "m_iObserverMode") != 6 && GetEntPropEnt(client, Prop_Send, "m_hObserverTarget") != entity))
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
@ -991,18 +991,15 @@ void SQL_SetPrefix()
|
||||
{
|
||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
||||
}
|
||||
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
|
||||
else
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
delete fFile;
|
||||
|
||||
@ -217,18 +217,15 @@ void SQL_SetPrefix()
|
||||
{
|
||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
||||
}
|
||||
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
|
||||
else
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
delete fFile;
|
||||
|
||||
@ -142,18 +142,15 @@ void SQL_SetPrefix()
|
||||
{
|
||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
||||
}
|
||||
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
|
||||
else
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
delete fFile;
|
||||
|
||||
@ -1327,18 +1327,15 @@ void SQL_SetPrefix()
|
||||
{
|
||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
||||
}
|
||||
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
|
||||
else
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
delete fFile;
|
||||
|
||||
@ -2053,18 +2053,15 @@ void SQL_SetPrefix()
|
||||
{
|
||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
||||
}
|
||||
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
||||
|
||||
else
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
||||
{
|
||||
char[] sLine = new char[PLATFORM_MAX_PATH * 2];
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH * 2))
|
||||
{
|
||||
TrimString(sLine);
|
||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
delete fFile;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user