Skip to content

Commit a083a51

Browse files
committed
Fix: abuse prevention should supersede a SA-MP bug fix
1 parent 69ace6f commit a083a51

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

pawn/Driver/Driver.pwn

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,14 @@ public OnPlayerDeath(playerid, killerid, reason) {
417417
}
418418
}
419419

420+
// If `/kill` was used, it's possible that the death might be attributed to an invalid player
421+
// due to a SA-MP bug. Reset the |killerid| when this happens. Kill attribution for command
422+
// abuse will still be able to set the |killerid| to another player Id, however.
423+
if (preventKillLamers[playerid]) {
424+
killerid = INVALID_PLAYER_ID;
425+
preventKillLamers[playerid] = 0;
426+
}
427+
420428
// If the |playerid| has killed themselves, or through other means wants to avoid getting an
421429
// attributed kill from their opponent, we'll make sure we do it for them.
422430
if (killerid == INVALID_PLAYER_ID && g_lastTakenDamageTime[playerid] > 0 &&

pawn/Resources/Callbacks/OnPlayer/OnPlayerDeath.pwn

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,6 @@ LegacyPlayerDeath(playerid, killerid, reason) {
9494
ClearPlayerMenus(playerid);
9595
iPlayerSesDeaths[playerid]++;
9696

97-
#if Feature::DisableFights == 0
98-
// An admin might use /kill in a fight, in which case we don't reset the killerid.
99-
if (preventKillLamers[playerid] && CFightClub__IsPlayerFighting(playerid))
100-
preventKillLamers[playerid] = 0;
101-
#endif
102-
103-
// SA:MP bug where killerid is still defined after /kill.
104-
if (preventKillLamers[playerid]) {
105-
killerid = Player::InvalidId;
106-
preventKillLamers[playerid] = 0;
107-
}
108-
10997
// Disallow self-nading to suicide when the player has been hit in the last 15 seconds.
11098
if (killerid == Player::InvalidId && reason == WEAPON_NONE && (Time->currentTime() - DamageManager(playerid)->getLastHitTime()) < 15)
11199
LegacySetValidKillerVariables(playerid, DamageManager(playerid)->getLastHitId(), WEAPON_EXPLOSION);

pawn/config.pwn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
class Version {
1010
public const Major = 49;
11-
public const Minor = 0;
11+
public const Minor = 1;
1212
};
1313

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

0 commit comments

Comments
 (0)