mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38: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))
|
if(gB_Zones && Shavit_ZoneExists(Zone_End))
|
||||||
{
|
{
|
||||||
Shavit_StopTimer(client);
|
Shavit_StopTimer(client);
|
||||||
|
|
||||||
Call_StartForward(gH_Forwards_OnEnd);
|
Call_StartForward(gH_Forwards_OnEnd);
|
||||||
Call_PushCell(client);
|
Call_PushCell(client);
|
||||||
Call_Finish();
|
Call_Finish();
|
||||||
@ -1203,17 +1204,14 @@ void SQL_SetPrefix()
|
|||||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
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))
|
||||||
{
|
{
|
||||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
TrimString(sLine);
|
||||||
|
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||||
|
|
||||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
break;
|
||||||
{
|
|
||||||
TrimString(sLine);
|
|
||||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fFile;
|
delete fFile;
|
||||||
|
|||||||
@ -240,7 +240,6 @@ public void OnPluginStart()
|
|||||||
|
|
||||||
// crons
|
// crons
|
||||||
CreateTimer(1.0, Timer_Scoreboard, 0, TIMER_REPEAT);
|
CreateTimer(1.0, Timer_Scoreboard, 0, TIMER_REPEAT);
|
||||||
CreateTimer(gF_AdvertisementInterval, Timer_Advertisement, 0, TIMER_REPEAT);
|
|
||||||
|
|
||||||
if(LibraryExists("dhooks"))
|
if(LibraryExists("dhooks"))
|
||||||
{
|
{
|
||||||
@ -370,6 +369,8 @@ public void OnMapStart()
|
|||||||
Shavit_OnStyleConfigLoaded(-1);
|
Shavit_OnStyleConfigLoaded(-1);
|
||||||
Shavit_OnChatConfigLoaded();
|
Shavit_OnChatConfigLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreateTimer(gF_AdvertisementInterval, Timer_Advertisement, 0, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LoadAdvertisementsConfig()
|
bool LoadAdvertisementsConfig()
|
||||||
@ -723,12 +724,10 @@ public void OnWeaponDrop(int client, int entity)
|
|||||||
// hide
|
// hide
|
||||||
public Action OnSetTransmit(int entity, int client)
|
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;
|
return Plugin_Continue;
|
||||||
@ -881,10 +880,10 @@ public int MenuHandler_Teleport(Menu menu, MenuAction action, int param1, int pa
|
|||||||
{
|
{
|
||||||
if(action == MenuAction_Select)
|
if(action == MenuAction_Select)
|
||||||
{
|
{
|
||||||
char[] info = new char[16];
|
char[] sInfo = new char[16];
|
||||||
menu.GetItem(param2, info, 16);
|
menu.GetItem(param2, sInfo, 16);
|
||||||
|
|
||||||
if(!Teleport(param1, StringToInt(info)))
|
if(!Teleport(param1, StringToInt(sInfo)))
|
||||||
{
|
{
|
||||||
Command_Teleport(param1, 0);
|
Command_Teleport(param1, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -992,17 +992,14 @@ void SQL_SetPrefix()
|
|||||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
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))
|
||||||
{
|
{
|
||||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
TrimString(sLine);
|
||||||
|
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||||
|
|
||||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
break;
|
||||||
{
|
|
||||||
TrimString(sLine);
|
|
||||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fFile;
|
delete fFile;
|
||||||
|
|||||||
@ -218,17 +218,14 @@ void SQL_SetPrefix()
|
|||||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
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))
|
||||||
{
|
{
|
||||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
TrimString(sLine);
|
||||||
|
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||||
|
|
||||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
break;
|
||||||
{
|
|
||||||
TrimString(sLine);
|
|
||||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fFile;
|
delete fFile;
|
||||||
|
|||||||
@ -143,17 +143,14 @@ void SQL_SetPrefix()
|
|||||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
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))
|
||||||
{
|
{
|
||||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
TrimString(sLine);
|
||||||
|
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||||
|
|
||||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
break;
|
||||||
{
|
|
||||||
TrimString(sLine);
|
|
||||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fFile;
|
delete fFile;
|
||||||
|
|||||||
@ -1328,17 +1328,14 @@ void SQL_SetPrefix()
|
|||||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
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))
|
||||||
{
|
{
|
||||||
char[] sLine = new char[PLATFORM_MAX_PATH*2];
|
TrimString(sLine);
|
||||||
|
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||||
|
|
||||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH*2))
|
break;
|
||||||
{
|
|
||||||
TrimString(sLine);
|
|
||||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fFile;
|
delete fFile;
|
||||||
|
|||||||
@ -2054,17 +2054,14 @@ void SQL_SetPrefix()
|
|||||||
SetFailState("Cannot open \"configs/shavit-prefix.txt\". Make sure this file exists and that the server has read permissions to it.");
|
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))
|
||||||
{
|
{
|
||||||
char[] sLine = new char[PLATFORM_MAX_PATH * 2];
|
TrimString(sLine);
|
||||||
|
strcopy(gS_MySQLPrefix, 32, sLine);
|
||||||
|
|
||||||
while(fFile.ReadLine(sLine, PLATFORM_MAX_PATH * 2))
|
break;
|
||||||
{
|
|
||||||
TrimString(sLine);
|
|
||||||
strcopy(gS_MySQLPrefix, 32, sLine);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete fFile;
|
delete fFile;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user