Skip to content
Permalink
Browse files
Fix: abuse prevention should supersede a SA-MP bug fix
  • Loading branch information
RussellLVP committed Jun 21, 2020
1 parent 69ace6f commit a083a51d15d93ab1a40bba470c3856be81aa5f21
Showing 3 changed files with 9 additions and 13 deletions.
@@ -417,6 +417,14 @@ public OnPlayerDeath(playerid, killerid, reason) {
}
}

// If `/kill` was used, it's possible that the death might be attributed to an invalid player
// due to a SA-MP bug. Reset the |killerid| when this happens. Kill attribution for command
// abuse will still be able to set the |killerid| to another player Id, however.
if (preventKillLamers[playerid]) {
killerid = INVALID_PLAYER_ID;
preventKillLamers[playerid] = 0;
}

// If the |playerid| has killed themselves, or through other means wants to avoid getting an
// attributed kill from their opponent, we'll make sure we do it for them.
if (killerid == INVALID_PLAYER_ID && g_lastTakenDamageTime[playerid] > 0 &&
@@ -94,18 +94,6 @@ LegacyPlayerDeath(playerid, killerid, reason) {
ClearPlayerMenus(playerid);
iPlayerSesDeaths[playerid]++;

#if Feature::DisableFights == 0
// An admin might use /kill in a fight, in which case we don't reset the killerid.
if (preventKillLamers[playerid] && CFightClub__IsPlayerFighting(playerid))
preventKillLamers[playerid] = 0;
#endif

// SA:MP bug where killerid is still defined after /kill.
if (preventKillLamers[playerid]) {
killerid = Player::InvalidId;
preventKillLamers[playerid] = 0;
}

// Disallow self-nading to suicide when the player has been hit in the last 15 seconds.
if (killerid == Player::InvalidId && reason == WEAPON_NONE && (Time->currentTime() - DamageManager(playerid)->getLastHitTime()) < 15)
LegacySetValidKillerVariables(playerid, DamageManager(playerid)->getLastHitId(), WEAPON_EXPLOSION);
@@ -8,7 +8,7 @@
*/
class Version {
public const Major = 49;
public const Minor = 0;
public const Minor = 1;
};

// Set this to 1 if you'd like to build Las Venturas Playground in release mode. This affects

0 comments on commit a083a51

Please sign in to comment.