Skip to content

Commit

Permalink
Merge pull request #28 from caxanga334/sigsegv-mvm-compat
Browse files Browse the repository at this point in the history
Sigsegv-mvm Compatibility
  • Loading branch information
caxanga334 authored Jul 31, 2023
2 parents f2434b3 + 1e5c84b commit 19c93aa
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions addons/sourcemod/scripting/tf_bwr_redux.sp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ enum

// Speak Concepts

// See https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/shared/mp_shareddefs.h#L19
enum
{
MP_CONCEPT_MVM_BOMB_CARRIER_UPGRADE1 = 99,
Expand Down Expand Up @@ -937,37 +938,42 @@ public void OnEntityCreated(int entity,const char[] name)

public Action OnPlayerRunCmd(int client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2])
{
if(!IsClientInGame(client) || IsFakeClient(client) || !IsPlayerAlive(client))
if(!IsClientInGame(client) || !IsPlayerAlive(client))
return Plugin_Continue;

RoboPlayer rp = RoboPlayer(client);
TFClassType class = TF2_GetPlayerClass(client);

if(class == TFClass_Spy)
// RED team logic, run for both human and bots
if (TF2_GetClientTeam(client) == TFTeam_Red)
{
int iDisguisedClass = GetEntProp(client, Prop_Send, "m_nDisguiseClass");
int iDisguisedTeam = GetEntProp(client, Prop_Send, "m_nDisguiseTeam");
if(g_nDisguised[client].g_iDisguisedClass != iDisguisedClass || g_nDisguised[client].g_iDisguisedTeam != iDisguisedTeam)
if(class == TFClass_Spy)
{
if(iDisguisedClass == 0 && iDisguisedTeam == 0)
int iDisguisedClass = GetEntProp(client, Prop_Send, "m_nDisguiseClass");
int iDisguisedTeam = GetEntProp(client, Prop_Send, "m_nDisguiseTeam");
if(g_nDisguised[client].g_iDisguisedClass != iDisguisedClass || g_nDisguised[client].g_iDisguisedTeam != iDisguisedTeam)
{
SpyDisguiseClear(client);
}
else
{
SpyDisguiseThink(client, iDisguisedClass, iDisguisedTeam);
if(iDisguisedClass == 0 && iDisguisedTeam == 0)
{
SpyDisguiseClear(client);
}
else
{
SpyDisguiseThink(client, iDisguisedClass, iDisguisedTeam);

g_nDisguised[client].g_iDisguisedClass = iDisguisedClass;
g_nDisguised[client].g_iDisguisedTeam = iDisguisedTeam;
g_nDisguised[client].g_iDisguisedClass = iDisguisedClass;
g_nDisguised[client].g_iDisguisedTeam = iDisguisedTeam;
}
}
}
else
{
SpyDisguiseClear(client);
}
}
else
{
SpyDisguiseClear(client);
}

if(TF2_GetClientTeam(client) == TFTeam_Blue)

// BLU team human player logic
if(TF2_GetClientTeam(client) == TFTeam_Blue && !IsFakeClient(client))
{
int iActiveWeapon = GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
BWRR_InstructPlayer(client);
Expand Down

0 comments on commit 19c93aa

Please sign in to comment.