Skip to content

Commit

Permalink
Fix assertion failed in Sfx::Sfx(const Json &jsonObj)
Browse files Browse the repository at this point in the history
Fix for "m_value.object->find(key) != m_value.object->end()" assertion error, because Sfx::Sfx(const Json &jsonObj) was trying to get "pos" and "vel" keys from passed "jsonObj" itself, when it should get it from "jsonObj[sfx]" object.
  • Loading branch information
Max5377 authored and Webster Sheets committed Nov 20, 2023
1 parent 1abf8b9 commit ddd6515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Sfx::Sfx(const Json &jsonObj)
try {
Json sfxObj = jsonObj["sfx"];

m_pos = jsonObj["pos"];
m_vel = jsonObj["vel"];
m_pos = sfxObj["pos"];
m_vel = sfxObj["vel"];
m_age = sfxObj["age"];
m_type = sfxObj["type"];
} catch (Json::type_error &) {
Expand Down

0 comments on commit ddd6515

Please sign in to comment.