openmultiplayer / openmultiplayer/open.mp

NPC_Respawn(): NPC cannot die after respawn

Open
#1,244 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
641
Forks
208
PR merge metrics
No merged PRs in 30d

Description

Версия: open.mp v1.5.8.3079

После вызова NPC_Respawn() NPC перестает умирать.

Шаги для воспроизведения:

  1. Создать NPC через NPC_Create() и NPC_Spawn().
  2. Убить NPC.
  3. Вызвать NPC_Respawn().
  4. Снова нанести NPC смертельный урон.

Ожидаемое поведение:

NPC должен умереть, должен вызваться OnNPCDeath().

Фактическое поведение:

  • OnNPCTakeDamage() продолжает вызываться.
  • HP уменьшается с 100 до 0.
  • NPC_GetHealth() возвращает:
    100.0 -> 53.7 -> 7.5 -> 0.0
  • После достижения 0 HP OnNPCDeath() больше не вызывается.
  • NPC остается живым и продолжает принимать урон с HP = 0.0.

создаём - /create
убиваем
респавним - /respawn
npc бессмертен!

test.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction steps in the issue and inspect test.txt for the NPC_Create(), NPC_Spawn(), and NPC_Respawn() setup. Reproduce the sequence, then trace the NPC damage and death callbacks, especially OnNPCTakeDamage() and OnNPCDeath(). Done means a respawned NPC can die again and OnNPCDeath() is called when its health reaches zero.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.