Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #29472 - nullptr while trying to find a NPC in the overmap #29487

Merged
merged 8 commits into from
Apr 13, 2019
Merged

Fix #29472 - nullptr while trying to find a NPC in the overmap #29487

merged 8 commits into from
Apr 13, 2019

Conversation

neitsa
Copy link
Contributor

@neitsa neitsa commented Apr 12, 2019

Summary

SUMMARY: Bugfixes "Fix #29472 - nullptr while trying to find a NCP in the overmap"

Purpose of change

Fix #29472 - nullptr while trying to find a NCP in the overmap

There were multiple missing checks on find_npc method which might return nullptr if the NCP can't be found in the overmap.

Describe the solution

  • Add the missing check for the crash issue.
  • Check all other locations where the function is used.

Add a simple check for nullptr. Add some debug msgs in missions to better diagnose the missing NPC problem.

Describe alternatives you've considered

There are probably no simpler alternatives.

Additional context

N/A.

src/game.cpp Outdated Show resolved Hide resolved
src/game.cpp Outdated Show resolved Hide resolved
Night-Pryanik and others added 2 commits April 12, 2019 16:36
src/game.cpp Outdated Show resolved Hide resolved
Co-Authored-By: neitsa <[email protected]>
@ifreund ifreund added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Apr 12, 2019
@neitsa neitsa changed the title Fix #29472 - nullptr while trying to find a NCP in the overmap Fix #29472 - nullptr while trying to find a NPC in the overmap Apr 12, 2019
@kevingranade kevingranade merged commit 50ac44e into CleverRaven:master Apr 13, 2019
@neitsa neitsa deleted the fix/29472 branch April 13, 2019 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault on map open or after few moves
4 participants