Fix some proj magnet issues

This commit is contained in:
Jackz 2022-07-26 22:24:21 -05:00
parent 0b51fe19ad
commit 9d7b6add57
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
3 changed files with 2 additions and 3 deletions

View file

@ -418,7 +418,6 @@ bool IsTrollActive(int client, const char[] troll) {
}
static int i = 0;
if(trollKV.GetValue(troll, i)) {
PrintToChatAll("index: %d. val: %d", i, Trolls[i].activeFlagClients[client] );
return Trolls[i].activeFlagClients[client] != -1;
}
ThrowError("Troll \"%s\" does not exist", troll);

View file

@ -503,9 +503,9 @@ int GetRandomThrowableMagnetTarget(ProjectileMagnetType type, int owner = -1) {
ArrayList checkList = new ArrayList();
for(int i = 1; i <= MaxClients; i++) {
if(IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i) && Trolls[throwMagnetIndex].IsActive(i)) {
if(type == ProjType_Survivors && owner != i) {
if(type == ProjType_Survivors) {
// If the projectile is not owned by player, check if troll flag not enabled
if(~Trolls[throwMagnetIndex].activeFlagClients[i] & view_as<int>(ProjType_Survivors)) continue;
if(owner != i && ~Trolls[throwMagnetIndex].activeFlagClients[i] & view_as<int>(ProjType_Survivors)) continue;
} else if(~Trolls[throwMagnetIndex].activeFlagClients[i] & view_as<int>(type)) {
// Skip if client does not have flag
continue;