|
3 | 3 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
4 | 4 | * obtain one at http://mozilla.org/MPL/2.0/. |
5 | 5 | * |
6 | | - * The original code is copyright (c) 2022, open.mp team and contributors. |
| 6 | + * The original code is copyright (c) 2025, open.mp team and contributors. |
7 | 7 | */ |
8 | 8 |
|
9 | 9 | #include "npc.hpp" |
@@ -33,6 +33,7 @@ NPC::NPC(NPCComponent* component, IPlayer* playerPtr) |
33 | 33 | , specialAction_(SpecialAction_None) |
34 | 34 | , invulnerable_(false) |
35 | 35 | , spawning_(false) |
| 36 | + , markedForKick_(false) |
36 | 37 | , meleeAttacking_(false) |
37 | 38 | , meleeAttackDelay_(0) |
38 | 39 | , meleeSecondaryAttack_(false) |
@@ -2574,7 +2575,7 @@ int NPC::getCurrentPathPointIndex() const |
2574 | 2575 |
|
2575 | 2576 | void NPC::tick(Microseconds elapsed, TimePoint now) |
2576 | 2577 | { |
2577 | | - if (player_) |
| 2578 | + if (player_ && !markedForKick_) |
2578 | 2579 | { |
2579 | 2580 | auto state = player_->getState(); |
2580 | 2581 |
|
@@ -2798,7 +2799,7 @@ void NPC::tick(Microseconds elapsed, TimePoint now) |
2798 | 2799 |
|
2799 | 2800 | // Check shooting again because NPC::shoot actually calls events and people may use stopAim in them. |
2800 | 2801 | // Therefore we are already in shooting_ == true scope, but it's not true anymore, so we don't want to |
2801 | | - // Be stuck with the wrong applied keys. But let it do the rest, let it reduce ammo count and do reload checks. |
| 2802 | + // Be stuck with the wrong applied keys. But let it do the rest, let it reduce ammo count and do reload checks. |
2802 | 2803 | if (shooting_) |
2803 | 2804 | { |
2804 | 2805 | applyKey(Key::AIM); |
|
0 commit comments