[Client] Fix crashes caused by inventory items with disabling scripts

0.6.1
David Cernat 8 years ago
parent f61664ff6d
commit d51736d68f

@ -592,7 +592,7 @@ namespace MWScript
*/ */
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen()) if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
{ {
if (!ref.getRefData().isEnabled()) if (!ref.getRefData().isEnabled() && ref.getCell() != nullptr)
{ {
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset(); worldEvent->reset();
@ -620,7 +620,7 @@ namespace MWScript
*/ */
if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen()) if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen())
{ {
if (ref.getRefData().isEnabled()) if (ref.getRefData().isEnabled() && ref.getCell() != nullptr)
{ {
mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent(); mwmp::WorldEvent *worldEvent = mwmp::Main::get().getNetworking()->getWorldEvent();
worldEvent->reset(); worldEvent->reset();

Loading…
Cancel
Save