Skip to content

Commit

Permalink
various micro optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
artvin01 committed Jan 26, 2025
1 parent ca56885 commit b137c40
Show file tree
Hide file tree
Showing 18 changed files with 129 additions and 218 deletions.
3 changes: 1 addition & 2 deletions addons/sourcemod/configs/zombie_riot/maps/zr_deepforest.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@
"shopcost" "24"
"dropchance" "2"

"func_collect" "Rogue_HandSupport_Collect"
"func_remove" "Rogue_HandSupport_Remove"
"func_weapon" "Rogue_HandSupport_Weapon"
}
"Hand of Geek"
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@
"shopcost" "12"
"dropchance" "8"
"func_collect" "Rogue_Item_HealingSalve"
"func_remove" "Rogue_Item_HealingSalveRemove"
"func_weapon" "Rogue_Item_HealingSalve"
}
"Steel Razor"
{
Expand Down Expand Up @@ -312,8 +311,7 @@
"shopcost" "24"
"dropchance" "2"
"func_collect" "Rogue_HandSupport_Collect"
"func_remove" "Rogue_HandSupport_Remove"
"func_weapon" "Rogue_HandSupport_Weapon"
}
"Hand of Geek"
{
Expand Down
6 changes: 3 additions & 3 deletions addons/sourcemod/scripting/rpg_fortress/rpg_core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void RPG_ClientDisconnect(int client)
FormatEx(buffer, sizeof(buffer), "%.3f;%.3f;%.3f;%.3f;%.3f;%.3f;%.3f;%.3f", f_ArmorHudOffsetX[client], f_ArmorHudOffsetY[client], f_HurtHudOffsetX[client], f_HurtHudOffsetY[client], f_WeaponHudOffsetX[client], f_WeaponHudOffsetY[client], f_NotifHudOffsetX[client], f_NotifHudOffsetY[client]);
HudSettings_Cookies.Set(client, buffer);

FormatEx(buffer, sizeof(buffer), "%b;%b;%b", b_HudScreenShake[client], b_HudLowHealthShake[client], b_HudHitMarker[client]);
FormatEx(buffer, sizeof(buffer), "%b;%b;%b", b_HudScreenShake[client], b_HudLowHealthShake_UNSUED[client], b_HudHitMarker[client]);
HudSettingsExtra_Cookies.Set(client, buffer);
}

Expand Down Expand Up @@ -551,14 +551,14 @@ static void HudSettings_ClientCookiesCached(int client)
bool buffers[3];
ExplodeStringInt(buffer, ";", buffers, sizeof(buffers));
b_HudScreenShake[client] = buffers[0];
b_HudLowHealthShake[client] = buffers[1];
b_HudLowHealthShake_UNSUED[client] = buffers[1];
b_HudHitMarker[client] = buffers[2];
}
else
{
// Cookie empty, get our own
b_HudScreenShake[client] = true;
b_HudLowHealthShake[client] = true;
b_HudLowHealthShake_UNSUED[client] = true;
b_HudHitMarker[client] = true;
}
}
Expand Down
8 changes: 4 additions & 4 deletions addons/sourcemod/scripting/rpg_fortress/store.sp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ static void ReShowSettingsHud(int client)

FormatEx(buffer, sizeof(buffer), "%t", "Low Health Shake");

if(b_HudLowHealthShake[client])
if(b_HudLowHealthShake_UNSUED[client])
{
FormatEx(buffer, sizeof(buffer), "%s %s", buffer, "[X]");
}
Expand Down Expand Up @@ -904,13 +904,13 @@ public int Settings_MenuPage(Menu menu, MenuAction action, int client, int choic
}
case -40:
{
if(b_HudLowHealthShake[client])
if(b_HudLowHealthShake_UNSUED[client])
{
b_HudLowHealthShake[client] = false;
b_HudLowHealthShake_UNSUED[client] = false;
}
else
{
b_HudLowHealthShake[client] = true;
b_HudLowHealthShake_UNSUED[client] = true;
}

ReShowSettingsHud(client);
Expand Down
6 changes: 3 additions & 3 deletions addons/sourcemod/scripting/shared/core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#if !defined UseDownloadTable
#include <filenetwork>
#endif
//#include <profiler>
#include <profiler>
#include <sourcescramble>
//#include <handledebugger>

Expand Down Expand Up @@ -1018,7 +1018,7 @@ public void OnMapStart()
Zero(Mana_Hud_Delay);
Zero(Mana_Regen_Delay);
Zero(Mana_Regen_Delay_Aggreviated);
Zero(RollAngle_Regen_Delay);
// Zero(RollAngle_Regen_Delay);
Zero(f_InBattleHudDisableDelay);
Zero(f_InBattleDelay);
Building_MapStart();
Expand Down Expand Up @@ -1533,7 +1533,7 @@ public void OnClientDisconnect(int client)
#endif

b_HudScreenShake[client] = true;
b_HudLowHealthShake[client] = true;
b_HudLowHealthShake_UNSUED[client] = true;
b_HudHitMarker[client] = true;
f_ZombieVolumeSetting[client] = 0.0;
}
Expand Down
6 changes: 1 addition & 5 deletions addons/sourcemod/scripting/shared/dhooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -2259,11 +2259,7 @@ public MRESReturn DHook_UpdateTransmitState(int entity, DHookReturn returnHook)
}
#endif
#if defined ZR
else if(b_thisNpcHasAnOutline[entity])
{
returnHook.Value = SetEntityTransmitState(entity, FL_EDICT_ALWAYS);
}
else if (!b_NpcHasDied[entity] && Zombies_Currently_Still_Ongoing <= 3 && Zombies_Currently_Still_Ongoing > 0)
else if (b_thisNpcHasAnOutline[entity] || !b_NpcHasDied[entity] && Zombies_Currently_Still_Ongoing <= 3 && Zombies_Currently_Still_Ongoing > 0)
{
returnHook.Value = SetEntityTransmitState(entity, FL_EDICT_ALWAYS);
}
Expand Down
1 change: 1 addition & 0 deletions addons/sourcemod/scripting/shared/events.sp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ public void OnPlayerResupply(Event event, const char[] name, bool dontBroadcast)
int client = GetClientOfUserId(userid);
if(client)
{
SetEntProp(client, Prop_Send, "m_iHideHUD", GetEntProp(client, Prop_Send, "m_iHideHUD") | HIDEHUD_BUILDING_STATUS | HIDEHUD_CLOAK_AND_FEIGN);
#if defined ZR
TransferDispenserBackToOtherEntity(client, true);
#endif
Expand Down
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/shared/global_arrays.sp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bool b_DisplayDamageHud[MAXTF2PLAYERS];
bool b_HudHitMarker[MAXTF2PLAYERS] = {true, ...};

bool b_HudScreenShake[MAXTF2PLAYERS] = {true, ...};
bool b_HudLowHealthShake[MAXTF2PLAYERS] = {true, ...};
bool b_HudLowHealthShake_UNSUED[MAXTF2PLAYERS] = {true, ...};
float f_ZombieVolumeSetting[MAXTF2PLAYERS];
int i_CurrentIdBeforeAnnoation[MAXTF2PLAYERS];
float f_TutorialUpdateStep[MAXTF2PLAYERS];
Expand Down Expand Up @@ -462,7 +462,7 @@ float Mana_Regen_Delay[MAXTF2PLAYERS];
float Mana_Regen_Delay_Aggreviated[MAXTF2PLAYERS];
float Mana_Regen_Block_Timer[MAXTF2PLAYERS];
float Mana_Loss_Delay[MAXTF2PLAYERS];
float RollAngle_Regen_Delay[MAXTF2PLAYERS];
//float RollAngle_Regen_Delay[MAXTF2PLAYERS];
bool b_FaceStabber[MAXENTITIES];
int Armor_Level[MAXPLAYERS + 1]={0, ...}; //701
int Jesus_Blessing[MAXPLAYERS + 1]={0, ...}; //777
Expand Down
Loading

0 comments on commit b137c40

Please sign in to comment.