Skip to content

Commit b70ae32

Browse files
committed
Fixes and additions
1 parent 60bff60 commit b70ae32

20 files changed

+523
-99
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
8+
branches:
9+
- master
710

811
jobs:
912
build-and-package:
@@ -103,6 +106,7 @@ jobs:
103106

104107
- name: Create GitHub Release
105108
uses: softprops/action-gh-release@v1
109+
if: github.event_name != 'pull_request'
106110
with:
107111
files: build/release/*.zip
108112
token: ${{ secrets.GITHUB_TOKEN }}

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@
9393
"cfenv": "cpp",
9494
"valarray": "cpp",
9595
"filesystem": "cpp",
96-
"*.cfg": "c"
96+
"*.cfg": "c",
97+
"text_encoding": "cpp",
98+
"hash_map": "cpp",
99+
"expected": "cpp",
100+
"ranges": "cpp"
97101
},
98102
"Lua.runtime.fileEncoding": "utf8",
99103
"Lua.diagnostics.disable": [

AMBuilder

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ if not Extension.optimize_mods_only:
160160
'src/mod/etc/ratelimit_exclude.cpp',
161161
'src/mod/etc/release_source_mutex.cpp',
162162
'src/mod/etc/server_allow_wait_command.cpp',
163+
'src/mod/etc/server_redirects.cpp',
163164
'src/mod/etc/suppress_nb_event_messages.cpp',
164165
'src/mod/etc/target_changegravity_improved.cpp',
165166
'src/mod/etc/vehicle_fix.cpp',
@@ -193,6 +194,7 @@ if not Extension.optimize_mods_only:
193194
# 'src/mod/util/screenshot_png.cpp',
194195
'src/mod/util/search_paths.cpp',
195196
'src/mod/util/vscript_send_output_to_admins.cpp',
197+
'src/mod/util/vscript_load_init_scripts.cpp',
196198
# 'src/mod/util/serialize_spew.cpp',
197199
# 'src/mod/util/vprof_remote.cpp',
198200
]

cfg/sigsegv_convars.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ sig_etc_ratelimit_exclude_commands "" // Mod: space-delimited list of commands
115115
sig_etc_ratelimit_exclude "0" // Mod: exclude selected client commands from server-side ratelimiting
116116
sig_etc_allow_wait_command "1" // Mod: always allow wait command on server
117117
sig_etc_suppress_nb_event_messages "0" // Mod: suppress NextBot event RESULT_CRITICAL collision console messages
118+
sig_etc_server_redirects "1" // Mod: Allows for server redirects with passwords
119+
sig_etc_server_redirects_redirect_only "0" // This server is for redirects only
118120
sig_etc_target_changegravity_improved "0" // Mod: improve the target_changegravity entity so that it's actually usable
119121
sig_etc_vehicle_fix "1" // "Mod: fix prop_vehicle_driveable"
120122
sig_etc_weapon_mimic_teamnum "1" // Mod: weapon mimic teamnum fix
@@ -388,4 +390,5 @@ sig_util_vprof_recv "0" // Utility: vprof forwarding: client receive
388390
sig_util_vprof_send_host "jgvm-win8" // Network host to use for VProf transmission
389391
sig_util_vprof_send_port "30001" // Network port to use for VProf transmission
390392
sig_util_vprof_send "0" // Utility: vprof forwarding: server send
391-
sig_util_vscript_send_output_to_admins "1" // Utility: Send output and errors from vscript to admins
393+
sig_util_vscript_send_output_to_admins "1" // Utility: Send output and errors from vscript to admins
394+
sig_util_vscript_load_init_scripts "1" // "Utility: Load vscript serverinit.nut before mapspawn"

cfg/sigsegv_convars_no_mvm.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ sig_etc_ratelimit_exclude_commands "" // Mod: space-delimited list of commands
8888
sig_etc_ratelimit_exclude "0" // Mod: exclude selected client commands from server-side ratelimiting
8989
sig_etc_allow_wait_command "1" // Mod: always allow wait command on server
9090
sig_etc_sendprop_override_extension "0" // Mod: Force load buildin proxysend/sendproxy extension. Loaded automatically when proxysend extension is detected in extensions
91+
sig_etc_server_redirects "1" // Mod: Allows for server redirects with passwords
92+
sig_etc_server_redirects_redirect_only "0" // This server is for redirects only
9193
sig_etc_suppress_nb_event_messages "0" // Mod: suppress NextBot event RESULT_CRITICAL collision console messages
9294
sig_etc_target_changegravity_improved "0" // Mod: improve the target_changegravity entity so that it's actually usable
9395
sig_etc_vehicle_fix "1" // Etc: fix prop_vehicle_driveable
@@ -122,4 +124,5 @@ sig_util_listenserverhost "0" // Utility: override UTIL_GetListenServerHost on
122124
sig_util_make_item "1" // Utility: enable sig_makeitem_* client commands
123125
sig_util_make_item_adminonly "1" // Utility: restrict this mod's functionality to SM admins only
124126
sig_util_pooled_string_fix "0" // Mod: Always enable the 65k+ pooled strings fix
125-
sig_util_vscript_send_output_to_admins "1" // Utility: Send output and errors from vscript to admins
127+
sig_util_vscript_send_output_to_admins "1" // Utility: Send output and errors from vscript to admins
128+
sig_util_vscript_load_init_scripts "1" // "Utility: Load vscript serverinit.nut before mapspawn"

gamedata/sigsegv/entities.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@
10431043
"CTFWeaponBaseMelee::SecondaryAttack" "_ZN18CTFWeaponBaseMelee15SecondaryAttackEv"
10441044
"CTFWeaponBaseMelee::Smack" "_ZN18CTFWeaponBaseMelee5SmackEv"
10451045
"CTFWeaponBaseMelee::Swing" "_ZN18CTFWeaponBaseMelee5SwingEP9CTFPlayer"
1046+
"CTFWrench::Smack" "_ZN9CTFWrench5SmackEv"
10461047
"CTFWeaponBuilder::CanDeploy" "_ZN16CTFWeaponBuilder9CanDeployEv"
10471048
"CTFWeaponBuilder::GetViewModel" "_ZNK16CTFWeaponBuilder12GetViewModelEi"
10481049
"CTFWeaponBuilder::SetSubType" "_ZN16CTFWeaponBuilder10SetSubTypeEi"

gamedata/sigsegv/globals.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
"CBaseEntity::m_pPredictionPlayer" "_ZN11CBaseEntity19m_pPredictionPlayerE"
141141
"g_pScriptVM" "g_pScriptVM"
142142
"g_GameStringPool" "_ZL16g_GameStringPool"
143+
"steamgameserverapicontext" "steamgameserverapicontext"
143144

144145
}
145146

@@ -163,6 +164,9 @@
163164
"g_BSPData" "g_BSPData"
164165
"g_HostState" "_ZL11g_HostState"
165166
"s_Steam3Server" "_ZL14s_Steam3Server"
167+
"g_bUseFakeIP" "g_bUseFakeIP"
168+
"g_nFakeIP" "g_nFakeIP"
169+
"g_arFakePorts" "g_arFakePorts"
166170
}
167171
}
168172
}

gamedata/sigsegv/misc.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,6 +3155,20 @@
31553155
type "sym"
31563156
sym "_Z23COM_GetUncompressedSizePKvj"
31573157
}
3158+
3159+
"CBaseServer::CheckPassword"
3160+
{
3161+
lib "engine"
3162+
type "sym"
3163+
sym "_ZN11CBaseServer13CheckPasswordER8netadr_sPKcS3_"
3164+
}
3165+
3166+
"CBaseServer::ConnectClient"
3167+
{
3168+
lib "engine"
3169+
type "sym"
3170+
sym "_ZN11CBaseServer13ConnectClientER8netadr_siiiiPKcS3_S3_i"
3171+
}
31583172

31593173
}
31603174
"addrs_group"
@@ -3258,6 +3272,11 @@
32583272
"ClientData_Update" "_Z17ClientData_UpdateP11CBasePlayer"
32593273

32603274
"GetCurrentSkyCamera" "_Z19GetCurrentSkyCamerav"
3275+
3276+
"VScriptServerInit" "_Z17VScriptServerInitv"
3277+
"VScriptRunScript" "_Z16VScriptRunScriptPKcP9HSCRIPT__b"
3278+
"CServerGameDLL::GetServerBrowserMapOverride" "_ZN14CServerGameDLL27GetServerBrowserMapOverrideEv"
3279+
32613280
}
32623281

32633282
"addrs_group"

src/convar_restore.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ namespace ConVar_Restore
1717
std::list<ConVar *> s_ConVars;
1818
std::list<ConCommand *> s_ConCmds;
1919

20-
20+
const char *GetConfigFileName()
21+
{
22+
int param = CommandLine()->FindParm("-sig_config_file");
23+
if (param == 0) {
24+
return "cfg/sigsegv_convars.cfg";
25+
}
26+
else {
27+
return CommandLine()->GetParm(param + 1);
28+
}
29+
}
2130
void Register(ConCommandBase *pCommand)
2231
{
2332
/* ignore s_EmptyConVar */
@@ -97,28 +106,28 @@ namespace ConVar_Restore
97106

98107
//file.PutChar('}');
99108
if (!filesystem->WriteFile(path,"GAME", file)) {
100-
Warning("ConVar_Restore::Save: Could not save Ke27020yValues to \"cfg/sigsegv_convars.cfg\".\n");
109+
Warning("ConVar_Restore::Save: Could not save KeyValues to \"%s\".\n", path);
101110
}
102111

103112
//kv->deleteThis();
104113
}
105114

106115
void Save()
107116
{
108-
SaveActual(false, "cfg/sigsegv_convars.cfg");
117+
SaveActual(false, GetConfigFileName());
109118
}
110119

111120
void SaveNonDefault()
112121
{
113-
SaveActual(true, "cfg/sigsegv_convars.cfg");
122+
SaveActual(true, GetConfigFileName());
114123
}
115124

116125
void Load()
117126
{
118127
CCommandBuffer buf;
119128

120129
CUtlBuffer file( 0, 0, CUtlBuffer::TEXT_BUFFER );
121-
if (filesystem->ReadFile("cfg/sigsegv_convars.cfg", "GAME", file)) {
130+
if (filesystem->ReadFile(GetConfigFileName(), "GAME", file)) {
122131
char line[1024];
123132
while(file.GetBytesRemaining() > 0) {
124133
file.EatWhiteSpace();
@@ -193,6 +202,6 @@ namespace ConVar_Restore
193202
void OnExtUnload()
194203
{
195204
if (cvar_autosave.GetBool())
196-
SaveActual(false, "cfg/sigsegv_convars.cfg");
205+
SaveActual(false, GetConfigFileName());
197206
}
198207
}

src/mod/attr/custom_attributes.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4120,7 +4120,6 @@ namespace Mod::Attr::Custom_Attributes
41204120
for (int i = 0; i < 4; i++) {
41214121
int addcond = (iCondOverride >> (i * 8)) & 255;
41224122
if (addcond != 0) {
4123-
raise(SIGTRAP);
41244123
nCond = (ETFCond) addcond;
41254124
DETOUR_MEMBER_CALL(nCond, bool1);
41264125
addcond_overridden = true;

src/mod/etc/melee_ignore_teammates.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace Mod::Etc::Melee_Ignore_Teammates
3535
if (cleave_attack) {
3636
ForEachEntity([&](CBaseEntity *ent){
3737
int flags = ent->m_fFlags;
38-
if ((flags & FL_NPC || ent->IsCombatCharacter()) && !(flags & FL_OBJECT || flags & FL_CLIENT)) {
38+
if (((flags & FL_NPC) || ent->IsCombatCharacter() || (flags & FL_GRENADE)) && !(flags & FL_OBJECT || flags & FL_CLIENT)) {
3939
ent->m_fFlags |= FL_OBJECT;
4040
altered_flags.push_back(ent);
4141
}
@@ -74,6 +74,31 @@ namespace Mod::Etc::Melee_Ignore_Teammates
7474
}
7575
else {
7676
result = DETOUR_MEMBER_CALL(tr, cleave_attack, traces);
77+
// Check if there is a wall between us and the target, and if entity is alive
78+
if (traces != nullptr) {
79+
auto &tracesRef = *traces;
80+
FOR_EACH_VEC_BACK(tracesRef, i) {
81+
auto &trace = tracesRef[i];
82+
CBaseEntity *entity = trace.m_pEnt;
83+
if (entity != nullptr) {
84+
if (!entity->IsAlive()) {
85+
traces->Remove(i);
86+
continue;
87+
}
88+
89+
trace_t t;
90+
CTraceFilterNoNPCsOrPlayer f(nullptr, COLLISION_GROUP_NONE);
91+
UTIL_TraceLine(trace.startpos, trace.endpos + (trace.endpos - trace.startpos), MASK_SOLID_BRUSHONLY, &f, &t);
92+
if (t.DidHit()) {
93+
UTIL_TraceLine(trace.startpos, entity->WorldSpaceCenter(), MASK_SOLID_BRUSHONLY, &f, &t);
94+
}
95+
if (t.DidHit()) {
96+
traces->Remove(i);
97+
continue;
98+
}
99+
}
100+
}
101+
}
77102
}
78103

79104
if (cleave_attack) {

src/mod/etc/misc.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,23 @@ namespace Mod::Etc::Misc
249249
}
250250
}
251251

252+
RefCount rc_CTFWrench_Smack;
253+
DETOUR_DECL_MEMBER(void, CTFWrench_Smack)
254+
{
255+
SCOPED_INCREMENT(rc_CTFWrench_Smack);
256+
DETOUR_MEMBER_CALL();
257+
}
258+
259+
DETOUR_DECL_MEMBER(bool, CTraceFilterIgnorePlayers_ShouldHitEntity, IHandleEntity *pServerEntity, int contentsMask)
260+
{
261+
auto result = DETOUR_MEMBER_CALL(pServerEntity, contentsMask);
262+
if (result && rc_CTFWrench_Smack) {
263+
auto entity = EntityFromEntityHandle(pServerEntity);
264+
if (entity != nullptr && entity->IsCombatItem()) return false;
265+
}
266+
return result;
267+
}
268+
252269
class CMod : public IMod
253270
{
254271
public:
@@ -286,6 +303,10 @@ namespace Mod::Etc::Misc
286303

287304
// No deathcam if music is playing
288305
MOD_ADD_DETOUR_MEMBER(CTFPlayer_Event_Killed, "CTFPlayer::Event_Killed");
306+
307+
// Shields do not block building repair now
308+
MOD_ADD_DETOUR_MEMBER(CTraceFilterIgnorePlayers_ShouldHitEntity, "CTraceFilterIgnorePlayers::ShouldHitEntity");
309+
MOD_ADD_DETOUR_MEMBER(CTFWrench_Smack, "CTFWrench::Smack");
289310
}
290311
};
291312
CMod s_Mod;

0 commit comments

Comments
 (0)