Hopefully fix witch crash

This commit is contained in:
Jackz 2022-08-16 20:21:16 -05:00
parent 8338263ccb
commit ac1897d5fa
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
4 changed files with 3 additions and 4 deletions

Binary file not shown.

View file

@ -352,11 +352,11 @@ void ApplyTroll(int victim, const char[] name, int activator, trollModifier modi
}
}
bool isActive = IsTrollActive(victim, troll.name);
bool isActive = Trolls[trollIndex].activeFlagClients[victim] > -1;
// Toggle on flags for client, if it's not a single run.
if(modifier & TrollMod_Constant) {
Trolls[troll.id].activeFlagClients[victim] = isActive ? -1 : flags;
Trolls[trollIndex].activeFlagClients[victim] = isActive ? -1 : flags;
}
// Applies any custom logic needed for a troll, mostly only used for TrollMod_Instant

View file

@ -21,7 +21,7 @@ bool SetWitchTarget(int witch, int target) {
#if defined _actions_included
g_iWitchAttackVictim = target;
BehaviorAction action = ActionsManager.GetAction(witch, "WitchBehavior");
if(action == INVALID_ACTION) {
if(action == INVALID_ACTION || action.Child == INVALID_ACTION) {
return false;
}
action = action.Child;

View file

@ -85,7 +85,6 @@ public void OnPluginStart() {
RegAdminCmd("sm_insta", Command_InstaSpecial, ADMFLAG_KICK, "Spawns a special that targets them, close to them.");
RegAdminCmd("sm_stagger", Command_Stagger, ADMFLAG_KICK, "Stagger a player");
RegAdminCmd("sm_inface", Command_InstaSpecialFace, ADMFLAG_KICK, "Spawns a special that targets them, right in their face.");
// TODO: Merge as trolls
RegAdminCmd("sm_bots_attack", Command_BotsAttack, ADMFLAG_CHEATS, "Instructs all bots to attack a player until they have X health.");
RegAdminCmd("sm_scharge", Command_SmartCharge, ADMFLAG_CHEATS, "Auto Smart charge");
RegAdminCmd("sm_healbots", Command_HealTarget, ADMFLAG_CHEATS, "Make bots heal a player");