diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 1830be693..31a8126b0 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -2,6 +2,9 @@ #include +#include +#include "../mwmp/Main.hpp" + #include #include #include @@ -668,7 +671,16 @@ namespace MWScript runtime.pop(); if (parameter == 1) + { + // Added by tes3mp + mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent(); + event->cell = *ptr.getCell()->getCell(); + event->cellRef.mRefID = ptr.getCellRef().getRefId(); + event->cellRef.mRefNum = ptr.getCellRef().getRefNum(); + mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_DELETE)->Send(event); + MWBase::Environment::get().getWorld()->deleteObject(ptr); + } else if (parameter == 0) MWBase::Environment::get().getWorld()->undeleteObject(ptr); else